changeset 2346:eb3c2da11ba1

separate item views as the itemviews template (basic theme)
author sharky93 <rishabhr123@gmail.com>
date Thu, 25 Jul 2013 12:50:22 +0530
parents 7dd810dc82e1
children c6bf9e64c84f
files MoinMoin/themes/basic/templates/itemviews.html MoinMoin/themes/basic/templates/modify.html MoinMoin/themes/basic/templates/show.html
diffstat 3 files changed, 95 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/themes/basic/templates/itemviews.html	Thu Jul 25 12:50:22 2013 +0530
@@ -0,0 +1,83 @@
+{% set exists = storage.has_item(item_name) %}
+
+{% block views %}
+
+    <ul class="nav nav-tabs">
+        {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
+            {%- if not check_exists or check_exists and exists %}
+
+                {%- if endpoint == 'frontend.show_item' %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-eye-open"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                         <span class="icon-pencil"></span>   {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'frontend.history' %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-time"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'frontend.show_item_meta' %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-wrench"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'frontend.highlight_item' %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-picture"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'frontend.backrefs' %}
+                    <li>
+                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                        <span class="icon-share"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {%- if endpoint == 'special.comments' %}
+                    <li class="moin-toggle-comments-button">
+                        <a href="#" title="{{ title }}">
+                        <span class="icon-comment"></span>
+                            {{ label }}
+                        </a>
+                    </li>
+                {%- endif %}
+
+                {% if endpoint == 'special.transclusions' -%}
+                    <li class="moin-transclusions-button">
+                        <a href="#" title="{{ title }}">
+                        <span class="icon-edit"></span>
+                            {{ label }}</a>
+                    </li>
+                {%- endif %}
+
+            {%- endif %}
+        {% endfor %}
+
+    </ul>
+{% endblock %}
--- a/MoinMoin/themes/basic/templates/modify.html	Wed Jul 24 21:08:35 2013 +0530
+++ b/MoinMoin/themes/basic/templates/modify.html	Thu Jul 25 12:50:22 2013 +0530
@@ -1,6 +1,15 @@
-{% extends "modify.html" %}
+{% extends theme("layout.html") %}
+{% import "forms.html" as forms %}
+{% import "utils.html" as utils %}
 {% from theme("modify_meta.html") import basic_meta_editor %}
 {% from theme("modify_text.html") import basic_data_editor %}
+{% import theme("itemviews.html") as itemviews with context %}
+
+{% set title = _("Modifying '%(item_name)s'", item_name=item_name) %}
+
+{% block views %}
+{{ itemviews }}
+{% endblock %}
 
 {% block content %}
 <h2>{{ title }}</h2>
@@ -12,7 +21,6 @@
        For *Draw content, hide submit button and form['comment'], since *Draw
        POSTs originate from their respective applets.
     #}
-    <br/>
     <div class="tabbable tabs-right">
         <ul class="nav nav-tabs">
             <li class="active"><a href="#editor" data-toggle="tab">Edit Content</a></li>
--- a/MoinMoin/themes/basic/templates/show.html	Wed Jul 24 21:08:35 2013 +0530
+++ b/MoinMoin/themes/basic/templates/show.html	Thu Jul 25 12:50:22 2013 +0530
@@ -1,87 +1,10 @@
 {% extends theme("layout.html") %}
 {% import "utils.html" as utils %}
+{% import theme("itemviews.html") as itemviews with context %}
 {% set exists = storage.has_item(item_name) %}
 
 {% block views %}
-
-    <ul class="nav nav-tabs">
-        {%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
-            {%- if not check_exists or check_exists and exists %}
-
-                {%- if endpoint == 'frontend.show_item' %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        <span class="icon-eye-open"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                         <span class="icon-pencil"></span>   {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'frontend.history' %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        <span class="icon-time"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'frontend.show_item_meta' %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        <span class="icon-wrench"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'frontend.highlight_item' %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        <span class="icon-picture"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'frontend.backrefs' %}
-                    <li>
-                        <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        <span class="icon-share"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {%- if endpoint == 'special.comments' %}
-                    <li class="moin-toggle-comments-button">
-                        <a href="#" title="{{ title }}">
-                        <span class="icon-comment"></span>
-                            {{ label }}
-                        </a>
-                    </li>
-                {%- endif %}
-
-                {% if endpoint == 'special.transclusions' -%}
-                    <li class="moin-transclusions-button">
-                        <a href="#" title="{{ title }}">
-                        <span class="icon-edit"></span>
-                            {{ label }}</a>
-                    </li>
-                {%- endif %}
-
-            {%- endif %}
-        {% endfor %}
-
-    </ul>
+    {{ itemviews }}
 {% endblock %}
 
 {% block content %}