changeset 1891:9a6a2ea3ffcf

fix for 284 item sizes and interwiki names views should show links rather than text
author Roger Haase <crosseyedpenguin@yahoo.com>
date Mon, 17 Dec 2012 08:56:38 -0700
parents 0f45ee838a89
children cbaa6b764de5
files MoinMoin/apps/admin/templates/user/interwikihelp.html MoinMoin/apps/admin/templates/user/itemsize.html MoinMoin/templates/utils.html
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/templates/user/interwikihelp.html	Sat Dec 08 13:59:54 2012 -0700
+++ b/MoinMoin/apps/admin/templates/user/interwikihelp.html	Mon Dec 17 08:56:38 2012 -0700
@@ -2,5 +2,5 @@
 {% extends theme("layout.html") %}
 {% block content %}
 <h1>{{ _("Known InterWiki names") }}</h1>
-{{ utils.table(headings, rows) }}
+{{ utils.table(headings, rows, url_cols=[2]) }}
 {% endblock %}
--- a/MoinMoin/apps/admin/templates/user/itemsize.html	Sat Dec 08 13:59:54 2012 -0700
+++ b/MoinMoin/apps/admin/templates/user/itemsize.html	Mon Dec 17 08:56:38 2012 -0700
@@ -2,5 +2,5 @@
 {% extends theme("layout.html") %}
 {% block content %}
 <h1>{{ _("Item sizes (latest revision)") }}</h1>
-{{ utils.table(headings, rows) }}
+{{ utils.table(headings, rows, itemname_cols=[2]) }}
 {% endblock %}
--- a/MoinMoin/templates/utils.html	Sat Dec 08 13:59:54 2012 -0700
+++ b/MoinMoin/templates/utils.html	Mon Dec 17 08:56:38 2012 -0700
@@ -23,7 +23,7 @@
 {% endmacro %}
 
 
-{% macro table(headings, rows) %}
+{% macro table(headings, rows, itemname_cols=[], url_cols=[]) %}
 <table class="zebra">
 <thead>
     <tr>
@@ -42,6 +42,10 @@
         {% for col in row %}
             {% if col is number %}
                 <td class="moin-integer">{{ col }}</td>
+            {% elif loop.index in itemname_cols %}
+                <td><a href="{{ url_for('frontend.show_item', item_name=col) }}">{{ col }}</a></td>
+            {% elif loop.index in url_cols %}
+                <td><a href="{{ col }}">{{ col }}</a></td>
             {%- else -%}
                 <td>{{ col }}</td>
             {% endif %}