Commits

Ashutosh Singla committed b02bac1

Added more support for 'all' identifier, Also fixed #24.

  • Participants
  • Parent commits 5beaf17

Comments (0)

Files changed (2)

File MoinMoin/apps/frontend/views.py

     return app.send_static_file('logos/favicon.ico')
 
 
-@frontend.route('/+all')
+@frontend.route('/all')
 def global_views():
     """
     Provides a link to all the global views.
     """
     return render_template('all.html',
                            title_name=_(u"Global Views."),
+                           fqname=CompositeName(u'all', NAME_EXACT, u'')
                           )
 
 
 
     dirs, files = item.get_index(startswith, selected_groups)
     # index = sorted(index, key=lambda e: e.relname.lower())
+    fqname = item.fqname
+    if fqname.value == NAMESPACE_ALL:
+        fqname = CompositeName(NAMESPACE_ALL, NAME_EXACT, u'')
     item_names = item_name.split(u'/')
     return render_template(item.index_template,
                            item_names=item_names,
                            item_name=item_name,
-                           fqname=item.fqname,
+                           fqname=fqname,
                            files=files,
                            dirs=dirs,
                            initials=initials,
                            startswith=startswith,
                            form=form,
+                           title_name=_(u'Global Index'),
     )
 
 
     all_revs = bool(request.values.get('all'))
     idx_name = ALL_REVS if all_revs else LATEST_REVS
     terms = [Term(WIKINAME, app.cfg.interwikiname)]
-    fqname = split_fqname(namespace)
+    fqname = CompositeName(NAMESPACE_ALL, NAME_EXACT, u'')
     if namespace != NAMESPACE_ALL:
         terms.append(Term(NAMESPACE, namespace))
+        fqname = split_fqname(namespace)
     bookmark_time = flaskg.user.bookmark
     if bookmark_time is not None:
         terms.append(DateRange(MTIME, start=datetime.utcfromtimestamp(bookmark_time), end=None))
     """
     title_name = _(u'All tags in this wiki')
     query = {WIKINAME: app.cfg.interwikiname}
+    fqname = CompositeName(NAMESPACE_ALL, NAME_EXACT, u'')
     if namespace != NAMESPACE_ALL:
         query[NAMESPACE] = namespace
-
+        fqname = split_fqname(namespace)
     revs = flaskg.storage.documents(**query)
     tags_counts = {}
     for rev in revs:
     return render_template("global_tags.html",
                            headline=_("All tags in this wiki"),
                            title_name=title_name,
+                           fqname=fqname,
                            tags=tags)
 
 

File MoinMoin/templates/layout.html

             {% block pagepath %}
             {% for segment_name, segment_path, exists in theme_supp.location_breadcrumbs(fqname) -%}
                 {% if loop.first %}
-                    <ul class="moin-bcs-item"><li>
-                {% endif %}
-                {% if not loop.last -%}
-                    <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
-                        {{ segment_name|shorten_fqname }}
-                    </a>
-                    {% if loop.first %}
-                        <ul class="moin-bcs-subitems">
-                            {% for namespace, root in theme_supp.get_namespaces(segment_name) -%}
-                                <li><a href="{{ url_for('frontend.show_item', item_name=root) }}">{{ namespace }}</a></li>
-                            {%- endfor %}
-                                <li><a href="{{ url_for('frontend.global_views') }}">{{ "all" }}</a></li>
-                        </ul></li>
-                        </ul>
-                    {% endif %}
+                    <ul class="moin-bcs-item">
+                        <li>
+                            <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>{{ segment_name|shorten_fqname }}</a>
+                            <ul class="moin-bcs-subitems">
+                                {% for namespace, root in theme_supp.get_namespaces(segment_name) -%}
+                                    <li><a href="{{ url_for('frontend.show_item', item_name=root) }}">{{ namespace }}</a></li>
+                                {%- endfor %}
+                                {% if fqname and fqname.namespace != "all" %}
+                                    <li><a href="{{ url_for('frontend.global_views') }}">{{ _("all") }}</a></li>
+                                {%- endif %}
+                           </ul>
+                        </li>
+                    </ul>
                     <span class="sep">/</span>
-                {% else %}
-                     {% if title_name %}
+                {% elif not loop.last %}
+                    <a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>{{ segment_name|shorten_fqname }}</a>
+                    <span class="sep">/</span>
+                {%- endif %}
+                {% if loop.last %}
+                    {% if title_name %}
                         {{ title_name }}
-                     {% else %}
+                    {% else %}
                         <ul class="moin-bcs-item">
                             <li><a href="{{ url_for('frontend.show_item', item_name=segment_path) }}" {% if not exists %}class="moin-nonexistent"{% endif %}>
                                 {{ segment_name|shorten_fqname }}</a>