changeset 149:601b8be0ced6

rename editbar to itemviews (template, css names)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 20 Mar 2011 20:32:30 +0100
parents 972943980b7b
children d3deda1731fb
files MoinMoin/static/js/common.js MoinMoin/templates/editbar.html MoinMoin/templates/itemviews.html MoinMoin/templates/layout.html MoinMoin/templates/show.html MoinMoin/themes/modernized/static/css/common.css
diffstat 6 files changed, 92 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js	Sun Mar 20 20:06:33 2011 +0100
+++ b/MoinMoin/static/js/common.js	Sun Mar 20 20:32:30 2011 +0100
@@ -132,10 +132,10 @@
         guiEditorLink.appendChild(text);
         var listItem = document.createElement('li')
         listItem.appendChild(guiEditorLink);
-        // Insert in the editbar
-        var editbar = textEditorLink.parentNode.parentNode
+        // Insert in the itemviews
+        var itemviews = textEditorLink.parentNode.parentNode
         var nextListItem = textEditorLink.parentNode.nextSibling;
-        editbar.insertBefore(listItem, nextListItem);
+        itemviews.insertBefore(listItem, nextListItem);
         //alert("add_gui_editor_links: added gui editor link");
     }
 }
--- a/MoinMoin/templates/editbar.html	Sun Mar 20 20:06:33 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-{% set exists = storage.has_item(item_name) %}
-<ul class="moin-editbar">
-    {% for endpoint, label, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
-        {% if (not check_exists or check_exists and exists) and endpoint in [
-               'frontend.show_item', 'frontend.index',
-               'frontend.highlight_item', 'frontend.show_item_meta', 'frontend.get_item',
-               'frontend.get_item', 'frontend.history', 'frontend.backrefs', 'frontend.sitemap',
-               'frontend.similar_names',
-               'frontend.modify_item',
-               'frontend.copy_item', 'frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item',
-           ] -%}
-            <li>
-            <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow"> {{ label }}</a>
-            </li>
-        {%- endif %}
-
-        {% if endpoint in [
-            'frontend.global_history', 'frontend.global_index', 'frontend.global_tags',
-            'admin.index',
-           ] -%}
-            <li>
-            <a href="{{ url_for(endpoint) }}" rel="nofollow"> {{ label }}</a>
-            </li>
-        {%- endif %}
-
-        {% if endpoint == 'frontend.quicklink_item' and user.valid -%}
-            <li>
-                <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow">
-                {% if user.isQuickLinkedTo([item_name]) -%}
-                    {{ _('Remove Link') }}
-                {% else -%}
-                    {{ _('Add Link') }}
-                {%- endif %}
-                </a>
-            </li>
-        {%- endif %}
-        {% if endpoint == 'frontend.subscribe_item' and user.valid -%}
-            <li>
-                <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow">
-                {% if user.isSubscribedTo([item_name]) %}
-                        {{ _('Unsubscribe') }}
-                {% else %}
-                        {{ _('Subscribe') }}
-                {% endif %}
-                </a>
-            </li>
-        {%- endif %}
-
-        {% if endpoint == 'special.delimiter' -%}
-            <li>*</li>
-        {%- endif %}
-        {% if endpoint == 'special.comments' -%}
-            <li class="toggleCommentsButton" style="display:none;">
-                <a href="#" onClick="toggleComments();return false;">{{ _('Comments') }}</a>
-            </li>
-        {%- endif %}
-        {% if endpoint == 'special.supplementation' -%}
-            {%- for sub_item_name in cfg.supplementation_item_names -%}
-                {% set current_sub = item_name.rsplit('/', 1)[-1] %}
-                {%- if not current_sub in cfg.supplementation_item_names -%}
-                    {% set supp_name = '%s/%s' % (item_name, sub_item_name) -%}
-                    {% if storage.has_item(supp_name) or user.may.write(supp_name) %}
-                        <li>
-                            <a href="{{ url_for('frontend.show_item', item_name=supp_name) }}" rel="nofollow">{{ _(sub_item_name) }}</a>
-                        </li>
-                    {%- endif %}
-                {%- endif %}
-            {%- endfor -%}
-        {%- endif %}
-    {% endfor %}
-</ul>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/templates/itemviews.html	Sun Mar 20 20:32:30 2011 +0100
@@ -0,0 +1,71 @@
+{% set exists = storage.has_item(item_name) %}
+<ul class="moin-itemviews">
+    {% for endpoint, label, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %}
+        {% if (not check_exists or check_exists and exists) and endpoint in [
+               'frontend.show_item', 'frontend.index',
+               'frontend.highlight_item', 'frontend.show_item_meta', 'frontend.get_item',
+               'frontend.get_item', 'frontend.history', 'frontend.backrefs', 'frontend.sitemap',
+               'frontend.similar_names',
+               'frontend.modify_item',
+               'frontend.copy_item', 'frontend.rename_item', 'frontend.delete_item', 'frontend.destroy_item',
+           ] -%}
+            <li>
+            <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow"> {{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {% if endpoint in [
+            'frontend.global_history', 'frontend.global_index', 'frontend.global_tags',
+            'admin.index',
+           ] -%}
+            <li>
+            <a href="{{ url_for(endpoint) }}" rel="nofollow"> {{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {% if endpoint == 'frontend.quicklink_item' and user.valid -%}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow">
+                {% if user.isQuickLinkedTo([item_name]) -%}
+                    {{ _('Remove Link') }}
+                {% else -%}
+                    {{ _('Add Link') }}
+                {%- endif %}
+                </a>
+            </li>
+        {%- endif %}
+        {% if endpoint == 'frontend.subscribe_item' and user.valid -%}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" rel="nofollow">
+                {% if user.isSubscribedTo([item_name]) %}
+                        {{ _('Unsubscribe') }}
+                {% else %}
+                        {{ _('Subscribe') }}
+                {% endif %}
+                </a>
+            </li>
+        {%- endif %}
+
+        {% if endpoint == 'special.delimiter' -%}
+            <li>*</li>
+        {%- endif %}
+        {% if endpoint == 'special.comments' -%}
+            <li class="toggleCommentsButton" style="display:none;">
+                <a href="#" onClick="toggleComments();return false;">{{ _('Comments') }}</a>
+            </li>
+        {%- endif %}
+        {% if endpoint == 'special.supplementation' -%}
+            {%- for sub_item_name in cfg.supplementation_item_names -%}
+                {% set current_sub = item_name.rsplit('/', 1)[-1] %}
+                {%- if not current_sub in cfg.supplementation_item_names -%}
+                    {% set supp_name = '%s/%s' % (item_name, sub_item_name) -%}
+                    {% if storage.has_item(supp_name) or user.may.write(supp_name) %}
+                        <li>
+                            <a href="{{ url_for('frontend.show_item', item_name=supp_name) }}" rel="nofollow">{{ _(sub_item_name) }}</a>
+                        </li>
+                    {%- endif %}
+                {%- endif %}
+            {%- endfor -%}
+        {%- endif %}
+    {% endfor %}
+</ul>
--- a/MoinMoin/templates/layout.html	Sun Mar 20 20:06:33 2011 +0100
+++ b/MoinMoin/templates/layout.html	Sun Mar 20 20:32:30 2011 +0100
@@ -118,7 +118,7 @@
         <hr style="display:none;" />
     </div>
 
-    {% block header_editbar %}{% endblock %}
+    {% block header_itemviews %}{% endblock %}
 
     {% for category, msg in get_flashed_messages(with_categories=true) %}
         <p class="moin-flash moin-flash-{{ category }}">{{ msg }}</p>
@@ -131,7 +131,7 @@
 
 <div id="moin-page" lang="{{ theme_supp.content_lang }}" dir="{{ theme_supp.content_dir }}">
     {% block item -%}
-        {# If you want editbar in your template, extend from show.html, not from here. #}
+        {# If you want itemviews in your template, extend from show.html, not from here. #}
         <div id="moin-content">
         {% block content %}
             {# All content templates should have implement this block. #}
@@ -144,7 +144,7 @@
 
 <div id="moin-footer">
 {% block footer %}
-    {% block footer_editbar %}{% endblock %}
+    {% block footer_itemviews %}{% endblock %}
     {% block footer_hr %}<hr/>{% endblock %}
     {{ creditlogos }}
     {% block footer_meta %}{% endblock %}
--- a/MoinMoin/templates/show.html	Sun Mar 20 20:06:33 2011 +0100
+++ b/MoinMoin/templates/show.html	Sun Mar 20 20:32:30 2011 +0100
@@ -10,10 +10,10 @@
     {%- endif %}
 {% endblock %}
 
-{% import "editbar.html" as editbar with context %}
+{% import "itemviews.html" as itemviews with context %}
 
-{% block header_editbar %}
-    {{ editbar }}
+{% block header_itemviews %}
+    {{ itemviews }}
 {% endblock %}
 
 {% macro rev_navigation(view='frontend.show_item') %}
@@ -61,8 +61,8 @@
 
 {% block footer_hr %}{% endblock %}
 
-{% block footer_editbar %}
-    {{ editbar }}
+{% block footer_itemviews %}
+    {{ itemviews }}
 {% endblock %}
 
 {% block footer_meta %}
--- a/MoinMoin/themes/modernized/static/css/common.css	Sun Mar 20 20:06:33 2011 +0100
+++ b/MoinMoin/themes/modernized/static/css/common.css	Sun Mar 20 20:32:30 2011 +0100
@@ -505,16 +505,16 @@
 #moin-pageline { clear: both; margin: 0; padding: 0; width: 100%; height: 4px;
             border-bottom: 1px solid #4D7DA9; border-top: 1px solid #4D7DA9; background: #81BBF2; }
 
-/* moin-header moin-editbar -- also applies to moin-footer */
-.moin-editbar { clear: both; display: block; margin: 0; padding: 2px 8px; background: #C4D9FF;
-            font-size: 0.8em; border-bottom: 1px solid #4D7DA9; border-top: 1px solid #4D7DA9; margin-top: -1px; }
-.moin-editbar li { display: inline; padding: 0; margin: 4px 6px; }
-.moin-editbar a,
-.moin-editbar a:visited { color: #0044B3; }
-.moin-editbar a:hover { text-decoration: underline; }
-.moin-editbar form,
-.moin-editbar form div { display: inline; margin: 0; }
-.moin-editbar select { font-size: 100%; vertical-align: middle; }
+/* moin-header moin-itemviews -- also applies to moin-footer */
+.moin-itemviews { clear: both; display: block; margin: 0; padding: 2px 8px; background: #C4D9FF;
+                  font-size: 0.8em; border-bottom: 1px solid #4D7DA9; border-top: 1px solid #4D7DA9; margin-top: -1px; }
+.moin-itemviews li { display: inline; padding: 0; margin: 4px 6px; }
+.moin-itemviews a,
+.moin-itemviews a:visited { color: #0044B3; }
+.moin-itemviews a:hover { text-decoration: underline; }
+.moin-itemviews form,
+.moin-itemviews form div { display: inline; margin: 0; }
+.moin-itemviews select { font-size: 100%; vertical-align: middle; }
 
 /* moin-page moin-footer */
 #moin-footer { clear: both; margin: 0 0; }