changeset 2450:1691455778f1

moves Item Navigation to the left, SiteMap and ItemIndex to the tabs
author sharky93 <rishabhr123@gmail.com>
date Sun, 08 Sep 2013 22:01:34 +0530
parents f423b258b317
children f82de71e4c64
files MoinMoin/themes/__init__.py MoinMoin/themes/basic/templates/layout.html MoinMoin/themes/basic/templates/show.html
diffstat 3 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sun Sep 08 18:37:59 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Sun Sep 08 22:01:34 2013 +0530
@@ -82,6 +82,7 @@
     def get_action_tabs(self, item_name, current_endpoint):
         navtabs_endpoints = ['frontend.show_item', 'frontend.history',
                             'frontend.show_item_meta', 'frontend.highlight_item', 'frontend.backrefs',
+                            'frontend.index', 'frontend.sitemap',
                             ]
         if self.user.may.write(item_name):
             navtabs_endpoints.append('frontend.modify_item')
@@ -115,7 +116,7 @@
 
     def get_local_panel(self, item_name):
         user_actions_endpoints = ['frontend.quicklink_item', 'frontend.subscribe_item', ]
-        item_navigation_endpoints = ['frontend.index', 'frontend.sitemap', 'special.supplementation']
+        item_navigation_endpoints = ['special.supplementation']
         item_actions_endpoints = ['frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item',
                 'frontend.similar_names', 'frontend.download_item', 
                 'frontend.copy_item',] if self.user.may.write(item_name) else []
--- a/MoinMoin/themes/basic/templates/layout.html	Sun Sep 08 18:37:59 2013 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Sun Sep 08 22:01:34 2013 +0530
@@ -4,6 +4,7 @@
 {% set logo = snippets.logo() %}
 {% set footer_logos = snippets.creditlogos() %}
 {% set credits = snippets.credits() %}
+{% set user_actions, item_navigation, item_actions = theme_supp.get_local_panel(item_name) %}
 
 {% if item_name in ['@NONAMEGIVEN',''] %}
 {% set current_url = url_for(request.endpoint) %}
@@ -11,6 +12,19 @@
 {% set current_url = url_for_item(endpoint = request.endpoint, item_name = item_name) %}
 {% endif %}
 
+{# Helper macro to generate the local panel #}
+{% macro local_panel_main(panelname, paneltitle) -%}
+    {% for endpoint, href, iconcls, label, title in panelname %}
+        {% if loop.first %}
+            <div class="list-group-item">{{ _(paneltitle) }}</div>
+        {% endif %}
+        <a class="list-group-item{% if href == current_url %} active{% endif %}" href="{{ href }}" title="{{ title }}" rel="nofollow">
+            <i class="{{ iconcls }} icon-fixed-width"></i>
+            {{ label }}
+        </a>
+    {% endfor %}
+{% endmacro %}
+
 {% block head %}
     {{ super() }}
     <link media="all" rel="stylesheet" href="{{ theme_static('css/basic.css') }}" />
@@ -97,6 +111,8 @@
                     {% for cls, url, text, title in navibar_items if cls != 'userlink' %}
                         <a class="list-group-item {{ cls }}{% if url == current_url %} active{% endif %}" href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text|shorten_item_name }}</a>
                     {% endfor %}
+                    
+                    {{ local_panel_main(item_navigation, "Item Navigation") }}
 
                     {% endif %}
                     
--- a/MoinMoin/themes/basic/templates/show.html	Sun Sep 08 18:37:59 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Sun Sep 08 22:01:34 2013 +0530
@@ -3,12 +3,11 @@
 {% import theme("itemviews.html") as itemviews with context %}
 {% set exists = storage.has_item(item_name) %}
 
-{% set user_actions, item_navigation, item_actions = theme_supp.get_local_panel(item_name) %}
-
-{% macro local_panel_main(panelname, paneltitle) %}
+{# Helper macro to generate the local panel #}
+{% macro local_panel_main(panelname, paneltitle) -%}
     {% for endpoint, href, iconcls, label, title in panelname %}
         {% if loop.first %}
-            <div class="list-group-item">{{ paneltitle }}</div>
+            <div class="list-group-item">{{ _(paneltitle) }}</div>
         {% endif %}
         <a class="list-group-item{% if href == current_url %} active{% endif %}" href="{{ href }}" title="{{ title }}" rel="nofollow">
             <i class="{{ iconcls }} icon-fixed-width"></i>
@@ -50,8 +49,6 @@
         <!-- user, site, item actions -->
     <div class="list-group">
         {{ self.user_actions() }}
-            
-        {{ self.item_navigation() }}
 
         <div class="list-group-item">View Options</div>
         <button type="button"