changeset 2732:cadd7e64a7e0

merged
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 16 Aug 2014 16:46:21 +0200
parents 63267bfa9099 (current diff) efb94e228614 (diff)
children 9d9e2bfcd04b 122424b4bc22
files
diffstat 4 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/ticket.py	Fri Aug 15 22:09:25 2014 +0530
+++ b/MoinMoin/items/ticket.py	Sat Aug 16 16:46:21 2014 +0200
@@ -23,10 +23,11 @@
                             Reference, BackReference, SelectSubmit, Text)
 from MoinMoin.storage.middleware.protecting import AccessDenied
 from MoinMoin.constants.keys import (ITEMTYPE, CONTENTTYPE, ITEMID, CURRENT,
-                                     SUPERSEDED_BY, SUBSCRIPTIONS, DEPENDS_ON, NAME, SUMMARY)
+                                     SUPERSEDED_BY, SUBSCRIPTIONS, DEPENDS_ON, NAME, SUMMARY, NAMESPACE)
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
 from MoinMoin.items import Item, Contentful, register, BaseModifyForm, get_itemtype_specific_tags
 from MoinMoin.items.content import NonExistentContent
+from MoinMoin.util.interwiki import CompositeName
 
 
 ITEMTYPE_TICKET = u'ticket'
@@ -189,7 +190,11 @@
                 except AccessDenied:
                     abort(403)
                 else:
-                    return redirect(url_for('.show_item', item_name=self.fqname))
+                    try:
+                        fqname = CompositeName(self.meta[NAMESPACE], ITEMID, self.meta[ITEMID])
+                    except KeyError:
+                        fqname = self.fqname
+                    return redirect(url_for('.show_item', item_name=fqname))
 
         # XXX When creating new item, suppress the "foo doesn't exist. Create it?" dummy content
         data_rendered = None if is_new else Markup(self.content._render_data())
--- a/MoinMoin/static/css/stylus/ticket.styl	Fri Aug 15 22:09:25 2014 +0530
+++ b/MoinMoin/static/css/stylus/ticket.styl	Sat Aug 16 16:46:21 2014 +0200
@@ -117,3 +117,6 @@
 
 dl dd
     padding-bottom 10px
+
+.moin-ticket-link
+    padding-left 150px
--- a/MoinMoin/static/css/ticket.css	Fri Aug 15 22:09:25 2014 +0530
+++ b/MoinMoin/static/css/ticket.css	Sat Aug 16 16:46:21 2014 +0200
@@ -14,3 +14,4 @@
 h2{border-bottom:none}
 dt label{padding-top:10px}
 dl dd{padding-bottom:10px}
+.moin-ticket-link{padding-left:150px}
--- a/MoinMoin/templates/ticket/base.html	Fri Aug 15 22:09:25 2014 +0530
+++ b/MoinMoin/templates/ticket/base.html	Sat Aug 16 16:46:21 2014 +0200
@@ -21,6 +21,11 @@
         'depends_on',
         ] %}
         {{ forms.render(form['meta'][e]) }}
+        {% if e!='assigned_to' and item.meta[e] %}
+            <dd>
+                <a class="moin-ticket-link"  href="{{ url_for_item(item.meta[e], field='itemid') }}">{{item.meta[e]|shorten_id}}</a>
+            </dd>
+        {% endif %}
     {% endfor %}
 {% endmacro %}