changeset 2740:122424b4bc22

Made ticket-create button in +tickets view working with a workaround
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Sat, 16 Aug 2014 20:27:39 +0530
parents cadd7e64a7e0
children 144023c286ee
files MoinMoin/apps/frontend/views.py MoinMoin/templates/tickets.html
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sat Aug 16 16:46:21 2014 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sat Aug 16 20:27:39 2014 +0530
@@ -2275,6 +2275,8 @@
     else:
         query = None
         status = u'open'
+
+    current_timestamp = datetime.now().strftime("%Y_%m_%d-%H_%M_%S")
     idx_name = ALL_REVS
     qp = flaskg.storage.query_parser([TAGS, SUMMARY, CONTENT, ITEMID], idx_name=idx_name)
     terms = [Term(ITEMTYPE, ITEMTYPE_TICKET)]
@@ -2319,6 +2321,7 @@
                                tags=tags,
                                selected_tags=selected_tags,
                                time_sorting=time_sorting,
+                               current_timestamp=current_timestamp,
         )
 
 
--- a/MoinMoin/templates/tickets.html	Sat Aug 16 16:46:21 2014 +0200
+++ b/MoinMoin/templates/tickets.html	Sat Aug 16 20:27:39 2014 +0530
@@ -47,7 +47,8 @@
     </ul>
 </div>
 
-<a id="moin-ticket-create-link" href="{{ url_for('frontend.new', itemtype='ticket') }}" >
+{# This is just a workaround for creating tickets #}
+<a id="moin-ticket-create-link" href="{{ url_for('frontend.modify_item', itemtype='ticket', item_name='ticket_'+current_timestamp ) }}" >
     <button class="btn btn-primary btn-lg btn-block">{{ _("Create ticket") }}</button>
 </a>