[marinemap] push by perrygeo...@gmail.com - Changes to bookmark templates. Also modify features/views to pass user... on 2011-10-26 18:47 GMT

0 views
Skip to first unread message

mari...@googlecode.com

unread,
Oct 26, 2011, 2:47:48 PM10/26/11
to marinema...@googlegroups.com
Revision: 356b93bcc66a
Author: Matthew Perry <perryg...@gmail.com>
Date: Wed Oct 26 11:49:50 2011
Log: Changes to bookmark templates. Also modify features/views to pass
user to template context var.
http://code.google.com/p/marinemap/source/detail?r=356b93bcc66a

Modified:
/lingcod/bookmarks/templates/bookmarks/form.html
/lingcod/bookmarks/templates/bookmarks/show.html
/lingcod/features/views.py
/media/bookmarks/css/bookmarks.css

=======================================
--- /lingcod/bookmarks/templates/bookmarks/form.html Thu Oct 20 10:34:46
2011
+++ /lingcod/bookmarks/templates/bookmarks/form.html Wed Oct 26 11:49:50
2011
@@ -68,11 +68,20 @@
</style>
<h1>{{ title }}</h1>

-<div class="bookmark-notice box" style="display:none;">The current view
has been recorded</div>
-
-<form id="featureform" action="{{action}}" method="post">
-
- <div class="box">
+<div class="box">
+ <span class="bookmark-notice" style="display:none;">
+ Your map view and public data layers have been recorded.
+ </span>
+ You can recapture the bookmark at any time.
+ <br/><br/>
+ <a href="#" id="camera_capture" class="button" onclick="this.blur();
return false;"><span>Recapture Bookmark</span></a>
+ <br/><br/>
+</div>
+
+
+<form id="featureform" action="{{action}}" method="post">
+<br/>
+ <div class="notbox">
{% for field in form.visible_fields %}
<div class="field{% if field.field.required %} required{%
endif %}">
{{ field.label_tag }}
@@ -93,7 +102,7 @@
{{hidden}}
{% endfor %}

- <label for="id_camera">Bookmark settings</label>
+ {% if user.is_staff %}
<div style="padding:5px">
<a href="#" id="fshow_toggle_details">show details</a>
<a href="#" id="fhide_toggle_details"
style="display:none;">hide details</a>
@@ -107,11 +116,9 @@
</ul>
</div>
</div>
-
- <p> <strong>Note:</strong> You can <em> Reset View</em> if you
have changed the view and wish to reflect that in the bookmark... </p>
- <div> <a href="#" class="button" id="camera_capture"
onclick="this.blur(); return false;"><span>Reset View</span></a></div>
<br/>
- <br/>
+ {% endif %}
+
</div>


=======================================
--- /lingcod/bookmarks/templates/bookmarks/show.html Tue Sep 20 17:25:42
2011
+++ /lingcod/bookmarks/templates/bookmarks/show.html Wed Oct 26 11:49:50
2011
@@ -20,7 +20,7 @@
$('#bookmark_loading').hide();
});
}
- {% if request.user.is_staff %}
+ {% if instance.user.is_staff %}
var tog = function() {
$('#show_toggle_details').toggle();
$('#hide_toggle_details').toggle();
=======================================
--- /lingcod/features/views.py Thu Oct 20 14:26:43 2011
+++ /lingcod/features/views.py Wed Oct 26 11:49:50 2011
@@ -239,6 +239,7 @@
)
else:
context = config.form_context
+ user = request.user
context.update({
'form': form,
'title': title,
@@ -247,6 +248,7 @@
'MEDIA_URL': settings.MEDIA_URL,
'is_spatial': issubclass(model, SpatialFeature),
'is_collection': issubclass(model, FeatureCollection),
+ 'user': user,
})
context = decorate_with_manipulators(context, form_class)
c = RequestContext(request, context)
@@ -268,6 +270,7 @@
if not request.user.is_authenticated():
return HttpResponse('You must be logged in.', status=401)
title = 'New %s' % (config.verbose_name)
+ user = request.user
context = config.form_context
if request.method == 'GET':
context.update({
@@ -278,6 +281,7 @@
'MEDIA_URL': settings.MEDIA_URL,
'is_spatial': issubclass(model, SpatialFeature),
'is_collection': issubclass(model, FeatureCollection),
+ 'user': user,
})
context = decorate_with_manipulators(context, form_class)
return render_to_response(config.form_template, context)
@@ -302,6 +306,7 @@
except:
raise Exception('Model to be edited must have a name attribute.')

+ user = request.user
config = model.get_options()
if request.method == 'GET':
form_class = config.get_form_class()
@@ -315,6 +320,7 @@
'MEDIA_URL': settings.MEDIA_URL,
'is_spatial': issubclass(model, SpatialFeature),
'is_collection': issubclass(model, FeatureCollection),
+ 'user': user,
})
context = decorate_with_manipulators(context, form_class)
return render_to_response(config.form_template, context)
=======================================
--- /media/bookmarks/css/bookmarks.css Thu Oct 20 10:34:46 2011
+++ /media/bookmarks/css/bookmarks.css Wed Oct 26 11:49:50 2011
@@ -2,8 +2,6 @@
#bookmark-feature-img {padding: 6px;}
#bookmark-menu-img {padding: 6px; padding-top:10px;}
.bookmark-notice {
- background-color: #EEE8AA !important;
- font-weight: bold;
text-align: center;
}
div .box {

Reply all
Reply to author
Forward
0 new messages