]> git.openstreetmap.org Git - osqa.git/commitdiff
be able to control right navigation visibility in the administration interface
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 25 Jan 2012 11:35:23 +0000 (11:35 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 25 Jan 2012 11:35:23 +0000 (11:35 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1223 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/osqaadmin/base.html
forum/skins/default/templates/osqaadmin/djstyle_base.html
forum/views/admin.py

index ff862c90461066d37107795f3a598727630cba4c..d27b2161afb6e184f65d6726c28174d5e05f8b93 100644 (file)
@@ -24,7 +24,9 @@
 {% endblock %}\r
 \r
 {% block sidebar %}\r
-    {% if user.is_superuser %}\r
+    {% if hide_navigation %}\r
+\r
+    {% else %}\r
     <div class="boxC">\r
         <a href="{% url admin_switch_interface %}?to=djstyle">{% trans "Switch to django style interface" %}</a>\r
         <h3 class="subtitle">{% trans "Administration menu" %}</h3>\r
index 25c4be0076b54cab940353d9f85c907a64bd687d..2f771921d2267c5ab26c711797fa1d0c44229aa7 100644 (file)
@@ -43,7 +43,7 @@
             {% block pagename %}{% endblock %} - 
             {% block description %}{% endblock %}
         </div>
-        <div id="content" class="{% if hide_menu %}flex{% else %}colMS{% endif %}">
+        <div id="content" class="{% if hide_navigation %}flex{% else %}colMS{% endif %}">
             <div id="content-main">
             {% autoescape off %}
                 {% for message in user_messages %}
@@ -52,7 +52,9 @@
             {% endautoescape %}
                 {% block admincontent %}{% endblock %}
             </div>
-            {% if not hide_menu %}
+            {% if hide_navigation %}
+
+            {% else %}
             <div id="content-related">
                 {% if unsaved %}
                 <div id="changes-box" class="module">
index 4823920c1099b6c3f6267a637684ce1bee53fd10..da9dc67cdc326bd4b7124b84d76657f60fdbdd27 100644 (file)
@@ -57,6 +57,10 @@ def admin_page_wrapper(fn, request, *args, **kwargs):
 
     context['tools'] = [(name, fn.label) for name, fn in TOOLS.items()]
 
+    # Show the navigation only to moderators and super users
+    if not context.has_key("hide_navigation"):
+        context['hide_navigation'] = not request.user.is_superuser
+
     unsaved = request.session.get('previewing_settings', {})
     context['unsaved'] = set([getattr(settings, s).set.name for s in unsaved.keys() if hasattr(settings, s)])
 
@@ -572,7 +576,7 @@ def node_management(request):
     'state_types': state_types,
     'authors': authors,
     'tags': tags,
-    'hide_menu': True
+    'hide_navigation': True
     }))
 
 @csrf_exempt