diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-02-01 13:18:45 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-02-01 13:18:45 +0100 |
commit | ec3320209e19c837705edc90d629d77bc2cdce5a (patch) | |
tree | cf872a42add605649c0fa5293f4c04fd69bef7c8 | |
parent | eeeba57a961bfc8571c5e1df7de88be3b37c9ee3 (diff) | |
download | Chimère-ec3320209e19c837705edc90d629d77bc2cdce5a.tar.bz2 Chimère-ec3320209e19c837705edc90d629d77bc2cdce5a.zip |
Templates: more explicit messages on edition pages.
-rw-r--r-- | chimere/templates/chimere/detail.html | 10 | ||||
-rw-r--r-- | chimere/templates/chimere/edit.html | 3 | ||||
-rw-r--r-- | chimere/templates/chimere/edit_route.html | 3 | ||||
-rw-r--r-- | chimere/views.py | 2 |
4 files changed, 12 insertions, 6 deletions
diff --git a/chimere/templates/chimere/detail.html b/chimere/templates/chimere/detail.html index 33ddfd1..eec932c 100644 --- a/chimere/templates/chimere/detail.html +++ b/chimere/templates/chimere/detail.html @@ -24,18 +24,19 @@ {% endfor %} {% if marker.origin %}<p class='detail_source'><strong>{% trans "Source:" %}</strong> <span>{{marker.origin}}</span></p>{% endif %} {% if marker.license %}<p class='detail_license'><strong>{% trans "License:" %}</strong> <span>{{marker.license}}</span></p>{% endif %} - {% if marker.multimedia_items %} + {% if marker.multimedia_items %}<p class='detail_multimedia'> <a href='#' class='show_gallery_link'>{% trans "Show multimedia gallery" %}</a> - {% endif %} + </p>{% endif %} </div> - <a href='{% if marker.route %}{% url chimere:editroute-item area_name_slash|default_if_none:"" marker.route.pk "" %}{%else%}{% url chimere:edit-item area_name_slash|default_if_none:"" marker.pk "" %}{%endif%}'> + <p class='detail_amendment'><a href='{% if marker.route %}{% url chimere:editroute-item area_name_slash|default_if_none:"" marker.route.pk "" %}{%else%}{% url chimere:edit-item area_name_slash|default_if_none:"" marker.pk "" %}{%endif%}'> {% trans "Submit an amendment" %} </a> {% if moderator_emails %} <a href="mailto:?from={{moderator_emails}}&subject={% trans "Propose amendment" %}&body={% trans "I would like to propose an amendment for this item:"%} {{share_url}}"> {% trans "Propose amendment" %} - </a>{%endif%} + </a>{%endif%}</p> {% if share_networks %} + <p class='detail_share'> {% if simple %}{% trans "Share on"%}{% for share_network in share_networks %} <a href='{{share_network.1}}'>{{share_network.0}}</a> {% endfor %}{%else%} @@ -43,6 +44,7 @@ <li>{% trans "Share"%}</li>{% for share_network in share_networks %} <li><a href='{{share_network.1}}'><img src="{{share_network.2}}" alt="{{share_network.0}}"/></a></li> {% endfor %}</ul>{% endif %} + </p> {% endif %} </div> {% if marker.multimedia_items %} diff --git a/chimere/templates/chimere/edit.html b/chimere/templates/chimere/edit.html index 66862cd..341f9b5 100644 --- a/chimere/templates/chimere/edit.html +++ b/chimere/templates/chimere/edit.html @@ -20,8 +20,9 @@ <legend>{% trans "Error" %}</legend> <p>{{ error_message }}</p> {% endif %}</fieldset> + {% if is_modification and is_superuser %}<div class='warning'><p>{% trans "You are logged as an administrator. Your modifications will be taking into account immediately." %}</p></div>{% endif %} <fieldset class='edit'> - <legend>{% trans "Add/modify a point of interest" %}</legend> + <legend>{% if is_modification %}{% trans "Modify a point of interest" %}{% else %}{% trans "Add a point of interest" %}{% endif %}</legend> <form enctype="multipart/form-data" method='post' action='.'> {% csrf_token %} <div class='rightWrapper'> diff --git a/chimere/templates/chimere/edit_route.html b/chimere/templates/chimere/edit_route.html index 0221949..10f4d5e 100644 --- a/chimere/templates/chimere/edit_route.html +++ b/chimere/templates/chimere/edit_route.html @@ -17,8 +17,9 @@ {{ block.super }} {% if submited %}{% submited %}{% endif %} {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} + {% if is_modification and is_superuser %}<div class='warning'><p>{% trans "You are logged as an administrator. Your modifications will be taking into account immediately." %}</p></div>{% endif %} <fieldset class='edit'> - <legend>{% trans "Add/modify a route" %}</legend> + <legend>{% if is_modification %}{% trans "Modify a route" %}{% else %}{% trans "Add a route" %}{% endif %}</legend> <form enctype="multipart/form-data" method='post' action='.'> {% csrf_token %} <div class='rightWrapper'> diff --git a/chimere/views.py b/chimere/views.py index 6a51394..a874c75 100644 --- a/chimere/views.py +++ b/chimere/views.py @@ -170,6 +170,7 @@ def get_edit_page(redirect_url, item_cls, item_form, submiter_session_key=request.session.session_key) if modified_item.count(): init_item = modified_item.all()[0] + response_dct['is_modification'] = True init_multi = init_item.get_init_multi() if init_item else None init_picture = init_item.get_init_picture() if init_item else None @@ -179,6 +180,7 @@ def get_edit_page(redirect_url, item_cls, item_form, # hide personal information for k in ('submiter_name', 'submiter_email', 'submiter_comment'): setattr(init_item, k, '') + response_dct['is_superuser'] = request.user.is_superuser # If the form has been submited if request.method == 'POST': inst = None |