fix routes
parent
ad0982bc2e
commit
030debeb5d
|
@ -30,7 +30,7 @@ def open_ticket():
|
||||||
description = request.form["description"]
|
description = request.form["description"]
|
||||||
t = ticket.create_ticket(g.team, summary, description)
|
t = ticket.create_ticket(g.team, summary, description)
|
||||||
flash("Ticket #{} opened.".format(t.id))
|
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>/')
|
@tickets.route('/tickets/<int:ticket_id>/')
|
||||||
|
@ -44,7 +44,7 @@ def detail(ticket_id):
|
||||||
return redirect(url_for(".index"))
|
return redirect(url_for(".index"))
|
||||||
|
|
||||||
comments = ticket.get_comments(t)
|
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"])
|
@tickets.route('/tickets/<int:ticket_id>/comment/', methods=["POST"])
|
||||||
|
@ -70,4 +70,4 @@ def comment(ticket_id):
|
||||||
ticket.open_ticket(t)
|
ticket.open_ticket(t)
|
||||||
flash("Ticket re-opened.")
|
flash("Ticket re-opened.")
|
||||||
|
|
||||||
return redirect(url_for(".detail", ticket=t.id))
|
return redirect(url_for(".detail", ticket_id=t.id))
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<small><abbr class="time" title="{{ comment.time }}">{{ comment.time }}</abbr> · {{ comment.comment_by }}</small>
|
<small><abbr class="time" title="{{ comment.time }}">{{ comment.time }}</abbr> · {{ comment.comment_by }}</small>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<br />
|
<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">
|
<div class="input-field">
|
||||||
<textarea id="comment" name="comment" class="materialize-textarea"></textarea>
|
<textarea id="comment" name="comment" class="materialize-textarea"></textarea>
|
||||||
<label for="comment">Comment</label>
|
<label for="comment">Comment</label>
|
||||||
|
|
|
@ -7,7 +7,7 @@ You have the following open tickets. If you're having an issue, you can <a href=
|
||||||
<div class="collection">
|
<div class="collection">
|
||||||
{% for ticket in tickets %}
|
{% for ticket in tickets %}
|
||||||
{% if ticket.active %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@ You have the following closed tickets:
|
||||||
<div class="collection">
|
<div class="collection">
|
||||||
{% for ticket in tickets %}
|
{% for ticket in tickets %}
|
||||||
{% if not ticket.active %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue