2019-02-11 17:18:09 +01:00
|
|
|
{% extends "layout-full.html" %}
|
2017-09-14 14:02:31 +02:00
|
|
|
{% block title %}
|
|
|
|
<title>
|
|
|
|
{{tracker.name}}
|
|
|
|
—
|
|
|
|
{{ cfg("sr.ht", "site-name") }} todo
|
|
|
|
</title>
|
|
|
|
{% endblock %}
|
2017-09-13 13:39:40 +02:00
|
|
|
{% block body %}
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
2018-07-14 16:40:52 +02:00
|
|
|
<div class="col-md-12 header-tabbed">
|
2017-11-09 04:49:39 +01:00
|
|
|
<h2>
|
2018-11-17 20:21:55 +01:00
|
|
|
<a href="{{ tracker.owner|user_url }}">{{ tracker.owner }}</a
|
|
|
|
>/{{ tracker.name }}
|
2018-07-14 16:40:52 +02:00
|
|
|
</h2>
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link {{ "active" if not search else "" }}"
|
2018-11-17 20:21:55 +01:00
|
|
|
href="{{ tracker|tracker_url }}">open tickets</a>
|
2018-07-14 16:40:52 +02:00
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link {{
|
2018-10-18 14:40:38 +02:00
|
|
|
"active" if search == "status:closed"
|
|
|
|
or search == "status:resolved" else ""
|
2018-07-14 16:40:52 +02:00
|
|
|
}}" href="?search=status:closed">closed tickets</a>
|
|
|
|
</li>
|
|
|
|
{% if search and search != "status:closed" and search != "status:resolved" %}
|
|
|
|
<li class="nav-item">
|
2018-10-18 14:40:38 +02:00
|
|
|
<a class="nav-link active" href="?search={{ search }}">
|
|
|
|
search results
|
|
|
|
</a>
|
2018-07-14 16:40:52 +02:00
|
|
|
</li>
|
|
|
|
{% endif %}
|
2018-10-15 13:18:49 +02:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link"
|
2018-11-17 20:21:55 +01:00
|
|
|
href="{{ tracker|tracker_labels_url }}">labels</a>
|
2018-10-15 13:18:49 +02:00
|
|
|
</li>
|
2018-07-11 03:29:20 +02:00
|
|
|
{% if current_user and current_user.id == tracker.owner_id %}
|
2018-07-14 16:40:52 +02:00
|
|
|
<li class="nav-item d-none d-sm-block">
|
2018-12-13 04:06:31 +01:00
|
|
|
<a class="nav-link" href="{{url_for(".settings_details_GET",
|
2018-12-30 21:52:29 +01:00
|
|
|
owner=tracker.owner.canonical_name,
|
2018-07-11 03:43:24 +02:00
|
|
|
name=tracker.name)}}"
|
2018-07-14 16:40:52 +02:00
|
|
|
>settings</a>
|
|
|
|
</li>
|
2018-07-11 03:29:20 +02:00
|
|
|
{% endif %}
|
2018-07-14 16:40:52 +02:00
|
|
|
{% if current_user %}
|
|
|
|
<li class="flex-grow-1 d-none d-sm-block"></li>
|
|
|
|
<li class="nav-item d-none d-sm-block">
|
|
|
|
<form method="POST" action="{{url_for("tracker." +
|
|
|
|
("disable_notifications" if is_subscribed else "enable_notifications"),
|
2018-12-30 21:52:29 +01:00
|
|
|
owner=tracker.owner.canonical_name,
|
2018-07-14 16:40:52 +02:00
|
|
|
name=tracker.name)}}">
|
2018-11-16 06:40:57 +01:00
|
|
|
{{csrf_token()}}
|
2018-07-14 16:40:52 +02:00
|
|
|
<button class="nav-link active" type="submit">
|
2018-09-01 19:43:05 +02:00
|
|
|
{{icon("envelope-o")}}
|
2018-07-14 16:40:52 +02:00
|
|
|
{% if is_subscribed %}
|
|
|
|
Disable notifications
|
|
|
|
{% else %}
|
|
|
|
Enable notifications
|
|
|
|
{% endif %}
|
2018-09-01 19:43:05 +02:00
|
|
|
{{icon("caret-right")}}
|
2018-07-14 16:40:52 +02:00
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
{% endif %}
|
|
|
|
</ul>
|
2017-09-13 13:39:40 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
2019-02-27 14:45:22 +01:00
|
|
|
{% if tracker.description %}
|
2017-09-13 13:39:40 +02:00
|
|
|
{{ tracker.description | md }}
|
2019-02-27 14:45:22 +01:00
|
|
|
{% endif %}
|
2018-06-23 21:38:45 +02:00
|
|
|
{% if TicketAccess.submit in access %}
|
2017-09-13 13:39:40 +02:00
|
|
|
<h3 style="margin-top: 1rem">Submit ticket</h3>
|
|
|
|
<form method="POST" action="{{
|
2017-09-14 04:09:32 +02:00
|
|
|
url_for(".tracker_submit_POST",
|
2017-09-13 14:02:25 +02:00
|
|
|
owner="~" + tracker.owner.username,
|
2017-09-13 13:39:40 +02:00
|
|
|
name=tracker.name
|
|
|
|
)
|
|
|
|
}}">
|
2018-11-16 06:40:57 +01:00
|
|
|
{{csrf_token()}}
|
2018-06-17 01:53:19 +02:00
|
|
|
<div class="form-group">
|
2017-09-13 13:39:40 +02:00
|
|
|
<label for="title">Title</label>
|
|
|
|
<input
|
|
|
|
type="text"
|
2018-06-17 01:53:19 +02:00
|
|
|
class="form-control {{ valid.cls("title") }}"
|
2017-09-13 14:02:25 +02:00
|
|
|
maxlength="2048"
|
2017-09-13 13:39:40 +02:00
|
|
|
id="title"
|
2017-09-13 14:02:25 +02:00
|
|
|
name="title"
|
2017-09-13 14:28:10 +02:00
|
|
|
autofocus
|
2017-09-13 14:02:25 +02:00
|
|
|
value="{{ title or "" }}" />
|
|
|
|
{{valid.summary("title")}}
|
2017-09-13 13:39:40 +02:00
|
|
|
</div>
|
2018-06-17 01:53:19 +02:00
|
|
|
<div class="form-group">
|
2017-09-13 13:39:40 +02:00
|
|
|
<label for="description">Description</label>
|
|
|
|
<textarea
|
2018-06-17 01:53:19 +02:00
|
|
|
class="form-control {{ valid.cls("description") }}"
|
2017-09-13 13:39:40 +02:00
|
|
|
id="description"
|
|
|
|
name="description"
|
|
|
|
placeholder="Markdown supported"
|
2017-09-13 14:02:25 +02:00
|
|
|
maxlength="16384"
|
|
|
|
rows="5">{{ description or "" }}</textarea>
|
|
|
|
{{valid.summary("description")}}
|
2017-09-13 13:39:40 +02:00
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
type="submit"
|
2018-06-17 01:23:03 +02:00
|
|
|
class="btn btn-primary"
|
|
|
|
>
|
2018-09-01 19:43:05 +02:00
|
|
|
Submit {{icon("caret-right")}}
|
2018-06-17 01:23:03 +02:00
|
|
|
</button>
|
|
|
|
<label class="form-check-label" style="margin-left: 2rem">
|
2017-09-13 13:39:40 +02:00
|
|
|
<input
|
|
|
|
class="form-check-input"
|
|
|
|
type="checkbox"
|
|
|
|
name="another"
|
|
|
|
style="position: relative; top: 2px;"
|
|
|
|
{% if another %}
|
|
|
|
checked
|
|
|
|
{% endif %}> Submit another?
|
|
|
|
</label>
|
|
|
|
</form>
|
2017-09-15 13:52:16 +02:00
|
|
|
{% else %}
|
|
|
|
<hr />
|
|
|
|
<p>You need to <a href="{{ oauth_url }}">log in</a> to submit tickets.</p>
|
|
|
|
{% endif %}
|
2017-09-13 13:39:40 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
2018-07-14 16:40:52 +02:00
|
|
|
<form style="margin-bottom: 0.5rem">
|
2017-09-13 13:39:40 +02:00
|
|
|
<input
|
|
|
|
name="search"
|
|
|
|
type="text"
|
2019-01-29 04:56:07 +01:00
|
|
|
placeholder="Search tickets... status:closed label:label order:updated submitter:me"
|
2017-09-13 13:39:40 +02:00
|
|
|
class="form-control"
|
|
|
|
value="{{ search if search else "" }}" />
|
|
|
|
</form>
|
2017-09-14 04:09:32 +02:00
|
|
|
{% if len(tickets) %}
|
2018-08-25 16:52:07 +02:00
|
|
|
<div class="ticket-list">
|
2018-12-04 17:47:58 +01:00
|
|
|
{% for ticket in tickets %}
|
2018-08-25 17:13:08 +02:00
|
|
|
<div class="id">
|
2018-11-17 20:21:55 +01:00
|
|
|
<a href="{{ ticket|ticket_url }}">#{{ticket.scoped_id}}</a>
|
|
|
|
</div>
|
2018-10-15 13:18:51 +02:00
|
|
|
<div class="title">
|
2019-02-22 22:35:22 +01:00
|
|
|
<a href="{{ ticket|ticket_url }}">
|
|
|
|
{{ ticket.title }}
|
|
|
|
</a>
|
2018-10-17 03:33:05 +02:00
|
|
|
<span class="pull-right">
|
2018-10-24 15:49:24 +02:00
|
|
|
{% for label in ticket.labels %}
|
2019-06-02 21:56:51 +02:00
|
|
|
{% if not search %}
|
|
|
|
{{ label|label_badge(cls="small", terms="status:open") }}
|
|
|
|
{% else %}
|
|
|
|
{{ label|label_badge(cls="small", terms=search) }}
|
|
|
|
{% endif %}
|
2018-10-17 03:33:05 +02:00
|
|
|
{% endfor %}
|
|
|
|
</span>
|
2018-10-15 13:18:51 +02:00
|
|
|
</div>
|
2018-08-25 17:13:08 +02:00
|
|
|
<div class="updated">{{ ticket.updated | date }}</div>
|
|
|
|
<div class="submitter">
|
2018-11-17 20:21:55 +01:00
|
|
|
<a href="{{ ticket.submitter|user_url }}">
|
|
|
|
{{ ticket.submitter }}
|
|
|
|
</a>
|
2018-08-25 16:52:07 +02:00
|
|
|
</div>
|
2018-08-25 17:13:08 +02:00
|
|
|
<div class="comments">
|
2019-08-02 19:43:57 +02:00
|
|
|
<span class="icon">
|
2019-08-07 07:01:07 +02:00
|
|
|
{% if ticket.id in seen_ticket_ids or comment_counts.get(ticket.id, 0) == 0 %}
|
2019-08-02 19:43:57 +02:00
|
|
|
{{icon("comments-o")}}
|
|
|
|
{% else %}
|
|
|
|
{{icon("comments")}}
|
|
|
|
{% endif %}
|
|
|
|
</span>
|
|
|
|
<span class="count">
|
|
|
|
{{ comment_counts.get(ticket.id, 0) }}
|
|
|
|
</span>
|
|
|
|
<span class="label">
|
|
|
|
{{ "comment" if comment_counts.get(ticket.id, 0) == 1
|
|
|
|
else "comments" }}
|
|
|
|
</span>
|
2018-08-25 16:52:07 +02:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2017-09-14 04:09:32 +02:00
|
|
|
{% else %}
|
|
|
|
<div class="alert alert-info">No tickets found for this search criteria.</div>
|
|
|
|
{% endif %}
|
2018-07-11 03:35:46 +02:00
|
|
|
{{pagination()}}
|
2017-09-13 13:39:40 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|