allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [09/14] allura git commit: [#7922] ticket:834 Don't show admin options twice on sidebar when left bar is hidden
Date Mon, 17 Aug 2015 19:38:17 GMT
[#7922] ticket:834 Don't show admin options twice on sidebar when left bar is hidden


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dd86014e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dd86014e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dd86014e

Branch: refs/heads/master
Commit: dd86014e039a66ab4bedf4e3acef976934f737b8
Parents: 41f60b9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Aug 13 19:12:47 2015 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Aug 17 17:54:14 2015 +0000

----------------------------------------------------------------------
 .../templates/jinja_master/sidebar_menu.html       | 17 +++++++++++------
 ForgeWiki/forgewiki/wiki_main.py                   |  4 ++--
 2 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/dd86014e/Allura/allura/templates/jinja_master/sidebar_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/sidebar_menu.html b/Allura/allura/templates/jinja_master/sidebar_menu.html
index 4505804..64102fc 100644
--- a/Allura/allura/templates/jinja_master/sidebar_menu.html
+++ b/Allura/allura/templates/jinja_master/sidebar_menu.html
@@ -55,21 +55,26 @@
     {% endif %}
     {% if c.app %}
       {% if h.has_access(c.app, 'admin')() %}
-        {% if c.app.admin_menu() %}
+        {% if c.app.tool_label.lower() == 'wiki' %}
+          {% set admin_menu = c.app.admin_menu(skip_common_menu=True) %}
+        {% else %}
+          {% set admin_menu = c.app.admin_menu() %}
+        {% endif %}
+        {% if admin_menu %}
           <a id='sidebar-admin-header' onclick='$("#sidebar-admin-menu").toggleClass("hidden");'>
             {{sidebar_item(c.app.admin_menu_collapse_button)}}
           </a>
           <div id='sidebar-admin-menu' class='hidden'>
-            {% for s in c.app.admin_menu() %}
+            {% for s in admin_menu %}
               {{sidebar_item(s)}}
             {% endfor %}
             {{sidebar_item(c.app.admin_menu_delete_button)}}
             {{sidebar_item(None)}}
           </div>
-        {% endif %}
-        {{c.app.admin_modal.display()}}
-        {% if c.app.admin_menu_delete_button %}
-          {{c.app.admin_tool_delete_modal.display()}}
+          {{c.app.admin_modal.display()}}
+          {% if c.app.admin_menu_delete_button %}
+            {{c.app.admin_tool_delete_modal.display()}}
+          {% endif %}
         {% endif %}
       {% endif %}
       {% for s in c.app.sidebar_menu() %}

http://git-wip-us.apache.org/repos/asf/allura/blob/dd86014e/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index d23cff8..e8dae94 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -257,7 +257,7 @@ The wiki uses [Markdown](%s) syntax.
                       SitemapEntry('Formatting Help', self.url + 'markdown_syntax/')]
         return links
 
-    def admin_menu(self):
+    def admin_menu(self, skip_common_menu=False):
         admin_url = c.project.url() + \
             'admin/' + \
             self.config.options.mount_point + '/'
@@ -265,7 +265,7 @@ The wiki uses [Markdown](%s) syntax.
                               admin_url + 'home',
                               className='admin_modal')]
 
-        if not self.show_left_bar:
+        if not self.show_left_bar and not skip_common_menu:
             links += self.create_common_wiki_menu(True,
                                                   admin_url +
                                                   'create_wiki_page',


Mime
View raw message