From 030debeb5d5082d91ea2313a50b2f2ee1c9856c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Sigur=C3=B0arson?= Date: Fri, 12 Aug 2016 14:55:06 +0100 Subject: [PATCH] fix routes --- routes/tickets.py | 6 +++--- templates/tickets/ticket_detail.html | 2 +- templates/tickets/tickets.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/routes/tickets.py b/routes/tickets.py index 46ff241..c26c28e 100644 --- a/routes/tickets.py +++ b/routes/tickets.py @@ -30,7 +30,7 @@ def open_ticket(): description = request.form["description"] t = ticket.create_ticket(g.team, summary, description) flash("Ticket #{} opened.".format(t.id)) - return redirect(url_for(".detail", ticket=t.id)) + return redirect(url_for(".detail", ticket_id=t.id)) @tickets.route('/tickets//') @@ -44,7 +44,7 @@ def detail(ticket_id): return redirect(url_for(".index")) comments = ticket.get_comments(t) - return render_template("ticket_detail.html", ticket=t, comments=comments) + return render_template("ticket_detail.html", ticket_id=t, comments=comments) @tickets.route('/tickets//comment/', methods=["POST"]) @@ -70,4 +70,4 @@ def comment(ticket_id): ticket.open_ticket(t) flash("Ticket re-opened.") - return redirect(url_for(".detail", ticket=t.id)) + return redirect(url_for(".detail", ticket_id=t.id)) diff --git a/templates/tickets/ticket_detail.html b/templates/tickets/ticket_detail.html index 54e124b..933fcd4 100644 --- a/templates/tickets/ticket_detail.html +++ b/templates/tickets/ticket_detail.html @@ -9,7 +9,7 @@ {{ comment.time }} · {{ comment.comment_by }} {% endfor %}
-
+
diff --git a/templates/tickets/tickets.html b/templates/tickets/tickets.html index 7008b61..0f0eaa8 100644 --- a/templates/tickets/tickets.html +++ b/templates/tickets/tickets.html @@ -7,7 +7,7 @@ You have the following open tickets. If you're having an issue, you can {% for ticket in tickets %} {% if ticket.active %} - #{{ ticket.id }} {{ ticket.summary }} + #{{ ticket.id }} {{ ticket.summary }} {% endif %} {% endfor %}
@@ -16,7 +16,7 @@ You have the following closed tickets:
{% for ticket in tickets %} {% if not ticket.active %} - #{{ ticket.id }} {{ ticket.summary }} + #{{ ticket.id }} {{ ticket.summary }} {% endif %} {% endfor %}