Andreas Kloeckner avatar Andreas Kloeckner committed a51ae80

Remove <ul> nesting from itemviews.

Comments (0)

Files changed (3)

MoinMoin/templates/itemviews.html

 {% set exists = storage.has_item(item_name) %}
-<ul class="moin-itemviews panel">
-    {%- 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 in [
-                'frontend.show_item', 'frontend.index', 'frontend.highlight_item',
-                'frontend.show_item_meta', 'frontend.download_item',
-                'frontend.history', 'frontend.backrefs', 'frontend.sitemap',
-                'frontend.similar_names', 'frontend.copy_item',
-            ] %}
-                <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
-                <li>
-                    <a class="moin-modify-button" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint in [
-                'frontend.rename_item', 'frontend.delete_item',
-            ] and user.may.write(item_name) %}
-                <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(item_name) %}
-                <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint in [
-                'frontend.global_history', 'frontend.global_index', 'frontend.global_tags',
-                'admin.index', 'admin.index_user',
-            ] %}
-                <li>
-                    <a href="{{ url_for(endpoint) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint == 'frontend.quicklink_item' and user.valid %}
-                <li>
-                    <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
-                        {%- if user.is_quicklinked_to([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) }}" title="{{ title }}" rel="nofollow">
-                        {%- if user.is_subscribed_to([item_name]) %}
-                            {{ _('Unsubscribe') }}
-                        {%- else %}
-                            {{ _('Subscribe') }}
-                        {%- endif %}
-                    </a>
-                </li>
-            {%- endif %}
-
-            {%- if endpoint == 'special.comments' %}
-                <li class="moin-toggle-comments-button" style="display:none;">
-                    <a href="#" onClick="toggleComments();return false;" title="{{ title }}">{{ label }}</a>
-                </li>
-            {%- endif %}
-
-        {% if endpoint == 'special.transclusions' -%}
-            <li class="moin-transclusions-button" style="display:none;">
-            <a href="#" onClick="toggleTransclusionOverlays();return false;" title="{{ title }}">{{ label }}</a>
+{%- 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 in [
+            'frontend.show_item', 'frontend.index', 'frontend.highlight_item',
+            'frontend.show_item_meta', 'frontend.download_item',
+            'frontend.history', 'frontend.backrefs', 'frontend.sitemap',
+            'frontend.similar_names', 'frontend.copy_item',
+        ] %}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</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 %}
+        {%- if endpoint == 'frontend.modify_item' and user.may.write(item_name) %}
+            <li>
+                <a class="moin-modify-button" href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {%- if endpoint in [
+            'frontend.rename_item', 'frontend.delete_item',
+        ] and user.may.write(item_name) %}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {%- if endpoint == 'frontend.destroy_item' and user.may.destroy(item_name) %}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {%- if endpoint in [
+            'frontend.global_history', 'frontend.global_index', 'frontend.global_tags',
+            'admin.index', 'admin.index_user',
+        ] %}
+            <li>
+                <a href="{{ url_for(endpoint) }}" title="{{ title }}" rel="nofollow">{{ label }}</a>
+            </li>
+        {%- endif %}
+
+        {%- if endpoint == 'frontend.quicklink_item' and user.valid %}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                    {%- if user.is_quicklinked_to([item_name]) %}
+                        {{ _('Remove Link') }}
+                    {%- else %}
+                        {{ _('Add Link') }}
                     {%- endif %}
-                {%- endfor %}
-            {%- endif %}
+                </a>
+            </li>
         {%- endif %}
-    {%- endfor %}
-</ul>
+
+        {%- if endpoint == 'frontend.subscribe_item' and user.valid %}
+            <li>
+                <a href="{{ url_for(endpoint, item_name=item_name) }}" title="{{ title }}" rel="nofollow">
+                    {%- if user.is_subscribed_to([item_name]) %}
+                        {{ _('Unsubscribe') }}
+                    {%- else %}
+                        {{ _('Subscribe') }}
+                    {%- endif %}
+                </a>
+            </li>
+        {%- endif %}
+
+        {%- if endpoint == 'special.comments' %}
+            <li class="moin-toggle-comments-button" style="display:none;">
+                <a href="#" onClick="toggleComments();return false;" title="{{ title }}">{{ label }}</a>
+            </li>
+        {%- endif %}
+
+    {% if endpoint == 'special.transclusions' -%}
+        <li class="moin-transclusions-button" style="display:none;">
+        <a href="#" onClick="toggleTransclusionOverlays();return false;" title="{{ title }}">{{ label }}</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 %}
+    {%- endif %}
+{%- endfor %}

MoinMoin/templates/show.html

 {% import "itemviews.html" as itemviews with context %}
 
 {% block header_itemviews %}
-    {{ itemviews }}
+    <ul class="moin-itemviews panel">
+        {{ itemviews }}
+    </ul>
 {% endblock %}
 
 {% macro rev_navigation(view='frontend.show_item') %}
 {% block footer_hr %}{% endblock %}
 
 {% block footer_itemviews %}
-    {{ itemviews }}
+    <ul class="moin-itemviews panel">
+        {{ itemviews }}
+    </ul>
 {% endblock %}
 
 {% block footer_meta %}

MoinMoin/themes/foobar/templates/show.html

 {% block local_panel %}
     <ul>
         <li class="panel">Views
-            {{ itemviews }}
+            <ul class="moin-itemviews panel">
+                {{ itemviews }}
+            </ul>
         </li>
         {% if rev %}
         <li id="moin-metadata">Metadata
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.