From ec3320209e19c837705edc90d629d77bc2cdce5a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 1 Feb 2013 13:18:45 +0100 Subject: Templates: more explicit messages on edition pages. --- chimere/templates/chimere/detail.html | 10 ++++++---- chimere/templates/chimere/edit.html | 3 ++- chimere/templates/chimere/edit_route.html | 3 ++- 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 %}

{% trans "Source:" %} {{marker.origin}}

{% endif %} {% if marker.license %}

{% trans "License:" %} {{marker.license}}

{% endif %} - {% if marker.multimedia_items %} + {% if marker.multimedia_items %}

{% trans "Show multimedia gallery" %} - {% endif %} +

{% endif %} - +

{% trans "Submit an amendment" %} {% if moderator_emails %} {% trans "Propose amendment" %} - {%endif%} + {%endif%}

{% if share_networks %} +

{% if simple %}{% trans "Share on"%}{% for share_network in share_networks %} {{share_network.0}} {% endfor %}{%else%} @@ -43,6 +44,7 @@

  • {% trans "Share"%}
  • {% for share_network in share_networks %}
  • {{share_network.0}}
  • {% endfor %}{% endif %} +

    {% endif %} {% 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 @@ {% trans "Error" %}

    {{ error_message }}

    {% endif %} + {% if is_modification and is_superuser %}

    {% trans "You are logged as an administrator. Your modifications will be taking into account immediately." %}

    {% endif %}
    - {% trans "Add/modify a point of interest" %} + {% if is_modification %}{% trans "Modify a point of interest" %}{% else %}{% trans "Add a point of interest" %}{% endif %}
    {% csrf_token %}
    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 %}

    {{ error_message }}

    {% endif %} + {% if is_modification and is_superuser %}

    {% trans "You are logged as an administrator. Your modifications will be taking into account immediately." %}

    {% endif %}
    - {% trans "Add/modify a route" %} + {% if is_modification %}{% trans "Modify a route" %}{% else %}{% trans "Add a route" %}{% endif %} {% csrf_token %}
    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 -- cgit v1.2.3