Thomas Waldmann avatar Thomas Waldmann committed 59cb25f Merge

merged

Comments (0)

Files changed (4)

MoinMoin/templates/layout.html

 {{ after_header }}
 
 <div id="moin-page" lang="{{ theme_supp.content_lang }}" dir="{{ theme_supp.content_dir }}">
+
+    {% block subitem_navigation %}{% endblock %}
+
     {% block item -%}
         {# If you want itemviews in your template, extend from show.html, not from here. #}
         <div id="moin-content">

MoinMoin/templates/show.html

     </ul>
 {% endmacro %}
 
+{% block subitem_navigation %}
+    {% set subitems = theme_supp.subitem_index(item_name) %}
+    {% if subitems %}
+        <div class="moin-subitem-navigation">
+            <div class="list-header">
+                {{ _('Subitems') }} 
+            </div>
+            <ul>
+                {% for fullname, shortname, contenttype, has_children in subitems %}
+                    <li>
+                        <a href="{{ url_for('frontend.show_item', item_name=fullname) }}"
+                            title="{{ shortname }}">{{ shortname }}</a>
+                        {% if has_children %}<span class="sep">/</span>{% endif %}
+                    </li>
+                {% endfor %}
+            </ul>
+        </div>
+    {% endif %}
+{% endblock %}
+
 {% block content %}
     {% if show_navigation %}
         {% block rev_navigation %}

MoinMoin/themes/__init__.py

 
 import urllib
 
+from operator import itemgetter
+
 from flask import current_app as app
 from flask import g as flaskg
 from flask import url_for, request
             breadcrumbs.append((wiki_name, item_name, href, exists, err))
         return breadcrumbs
 
+    def subitem_index(self, item_name):
+        """
+        Get a list of subitems for the given item_name
+
+        :rtype: list
+        :returns: list of item tuples (item_name, item_title, item_mime_type, has_children)
+        """
+        from MoinMoin.items import Item
+        item = Item.create(item_name)
+        item_index = item.get_detailed_index(item.flat_index())
+        # Sort items by whether or not they have children, then by name:
+        item_index = sorted(item_index, key=itemgetter(-1, 0))
+        return item_index
+
     def userhome(self):
         """
         Assemble arguments used to build user homepage link

MoinMoin/themes/modernized/static/css/common.css

 body { background-color: #F3F7FD; }
 
 /* moin-content */
-#moin-page { margin: 0; padding: 2px 20px 20px; box-shadow: 1px 1px 33px -11px inset;
-/* support for firefox 3.5/3.6 and safari */
--moz-box-shadow: 1px 1px 33px -11px inset; -webkit-box-shadow: inset 1px 1px 33px -11px black; }
+#moin-page { margin: 0; padding: 0; display: table; width: 100%; table-layout: fixed; }
+#moin-content { background: #FFF; overflow: hidden; box-shadow: 1px 1px 33px -11px inset; padding: 8px 25px; display: table-cell; 
+    /* support for firefox 3.5/3.6 and safari */
+    -moz-box-shadow: 1px 1px 33px -11px inset; -webkit-box-shadow: inset 1px 1px 33px -11px black; }
 
 /* links */
 a:link { color: #47F; text-decoration: none; }
 .moin-itemviews form div { display: inline; margin: 0; }
 .moin-itemviews select { font-size: 100%; vertical-align: middle; }
 
+/* moin-header moin-subitem-navigation */
+.moin-subitem-navigation {  padding: 2px 4px; background: #C4D9FF; margin: 0; vertical-align: top;
+                font-size: 0.8em; width: 14em; overflow: hidden; display: table-cell; word-wrap: break-word; }
+.moin-subitem-navigation .list-header { margin: 2px 0; padding: 0; font-size: 1.1em; }
+.moin-subitem-navigation .sep { font-size: 1.2em; margin-left: 0px; }
+.moin-subitem-navigation ul { display: block; margin: 0; padding: 0 4px; }
+.moin-subitem-navigation li { padding: 0.5em 2px; line-height: 1em; list-style: none; }
+.moin-subitem-navigation li:hover { background: #4D7DA9; }
+.moin-subitem-navigation a { color: #0044B3; }
+.moin-subitem-navigation a:hover { text-decoration: underline; }
+
 /* moin-page moin-footer */
 #moin-footer { clear: both; margin: 0 0; }
 #moin-footer hr { margin: 0; background-color: #ccc; }
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.