fix routes

master
James Sigurðarson 2016-08-12 14:55:06 +01:00
parent ad0982bc2e
commit 030debeb5d
3 changed files with 6 additions and 6 deletions

View File

@ -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/<int:ticket_id>/')
@ -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/<int:ticket_id>/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))

View File

@ -9,7 +9,7 @@
<small><abbr class="time" title="{{ comment.time }}">{{ comment.time }}</abbr> &middot; {{ comment.comment_by }}</small>
{% endfor %}
<br />
<form action="{{ url_for('.comment', ticket=ticket.id) }}" method="POST">
<form action="{{ url_for('.comment', ticket_id=ticket.id) }}" method="POST">
<div class="input-field">
<textarea id="comment" name="comment" class="materialize-textarea"></textarea>
<label for="comment">Comment</label>

View File

@ -7,7 +7,7 @@ You have the following open tickets. If you're having an issue, you can <a href=
<div class="collection">
{% for ticket in tickets %}
{% if ticket.active %}
<a class="collection-item" href="{{ url_for('.detail', ticket=ticket.id) }}">#{{ ticket.id }} {{ ticket.summary }}</a>
<a class="collection-item" href="{{ url_for('.detail', ticket_id=ticket.id) }}">#{{ ticket.id }} {{ ticket.summary }}</a>
{% endif %}
{% endfor %}
</div>
@ -16,7 +16,7 @@ You have the following closed tickets:
<div class="collection">
{% for ticket in tickets %}
{% if not ticket.active %}
<a class="collection-item" href="{{ url_for('.detail', ticket=ticket.id) }}">#{{ ticket.id }} {{ ticket.summary }}</a>
<a class="collection-item" href="{{ url_for('.detail', ticket_id=ticket.id) }}">#{{ ticket.id }} {{ ticket.summary }}</a>
{% endif %}
{% endfor %}
</div>