changeset 1829:6ef26d1fa2fe

Use different macros for dir and file in index, make dir items link to +index view instead of +show
author Cheer Xiao <xiaqqaix@gmail.com>
date Fri, 05 Oct 2012 11:13:28 +0800
parents 12053b28483d
children 9e8e47fd8fba
files MoinMoin/templates/index.html
diffstat 1 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/index.html	Thu Oct 04 10:12:19 2012 +0200
+++ b/MoinMoin/templates/index.html	Fri Oct 05 11:13:28 2012 +0800
@@ -69,8 +69,20 @@
     </div>
 {% endblock %}
 
-{% macro render_entry(e) %}
-    {% set maxchars = 20 %}
+{% set maxchars = 20 %}
+
+{% macro render_dir_entry(e) %}
+    <div>
+        <a href="{{ url_for('.index', item_name=e.meta['name']) }}"
+           {# TODO .moin-dir-item class is not styled yet #}
+           class="moin-dir-item"
+           title="{{ e.relname }}">
+           {{ e.relname|truncate(maxchars, true, '..') }}
+        </a>
+    </div>
+{% endmacro %}
+
+{% macro render_file_entry(e) %}
     <div>
         <span class="moin-select-item">&nbsp;</span>
         {% set mimetype = "application/x.moin.download" %}
@@ -82,12 +94,6 @@
            title="{{ e.relname }}">
            {{ e.relname|truncate(maxchars, true, '..') }}
         </a>
-        {% if e.hassubitems %}
-            <a href="{{ url_for('frontend.index', item_name=e.meta['name']) }}"
-               title="{{ _("More") }}"
-               class="moin-more-index">&nbsp;
-        </a>
-        {% endif %}
     </div>
 {% endmacro %}
 
@@ -138,7 +144,7 @@
         <div class="moin-item-index">
             <p>{{ _("These items have subitems that match your filter:") }}</p>
             {% for e in dirs %}
-                {{ render_entry(e) }}
+                {{ render_dir_entry(e) }}
             {% endfor %}
         </div>
         <div class="moin-clr"></div>
@@ -147,7 +153,7 @@
     {% if files %}
         <div class="moin-item-index">
             {% for e in files %}
-                {{ render_entry(e) }}
+                {{ render_file_entry(e) }}
             {% endfor %}
         </div>
         <div class="moin-clr"></div>