<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{$proj.name}}#{{$tick.code}} - {{$title}}</title>
<style>
.centered { text-align: center; }
.menu a { margin: 7px; }
.shift-button {
margin: 0 5px;
padding: 5px;
border: none;
background-color: #bbb;
cursor: pointer;
}
% include view/menu.css
% include view/ticket.css
</style>
</head>
<body>
% include view/menu.html
<h1 class="centered">{{$proj.name}} - ticket #{{$tick.code}}</h1>
<div class="ticket-details">
<h1>{{$tick.title}}</h1>
<div class="header-details">
<p class="date"><strong>Date:</strong> {{os.date("%F %R", $tick.time)}}</p>
<p class="author">
<strong>Author:</strong>
<a href="/u/{{$tick.author_nick}}">{{$tick.author_name}}</a>
</p>
</div>
<pre>{{$tick.desc}}</pre>
<div class="footer-details">
<p><strong>Priority:</strong> {{$tick.priority}}</p>
<div>
% set shift_path = "/p/"..$proj.name.."/t/"..$tick.code.."/shift"
<form action="{{$shift_path}}/left?from=tick" method="post">
<button class="shift-button" type="submit">←</button>
</form>
% if $tick.is_active == 1 then
{{$states[$tick.state_id]}}
% else
% if $tick.state_id == 1 then
backlog
% else
archive
% end
% end
<form action="{{$shift_path}}/right?from=tick" method="post">
<button class="shift-button" type="submit">→</button>
</form>
</div>
<div class="menu">
<a href="/p/{{$proj.name}}/t/{{$tick.code}}/edit">edit</a>
<form action="/p/{{$proj.name}}/t/{{$tick.code}}/del" method="post">
<button type="submit">delete</button>
</form>
</div>
</div>
</div>
<div class="comments-section">
% for ev in $events do
<div class="comment">
<div class="header-details">
<p class="date"><strong>Date:</strong> {{os.date("%F %R", $ev.time)}}</p>
<p class="author">
<strong>Author:</strong>
<a href="/u/{{$ev.author_nick}}">{{$ev.author_name}}</a>
</p>
</div>
% if $ev.type == "comment" then
<pre>{{$ev.text}}</pre>
<div class="footer-details">
<div class="menu">
<a href="/p/{{$proj.name}}/t/{{$tick.code}}/c/{{$ev.code}}/edit">edit</a>
<form action="/p/{{$proj.name}}/t/{{$tick.code}}/c/{{$ev.code}}/del" method="post">
<button type="submit">delete</button>
</form>
</div>
</div>
% end
% if $ev.type == "shift" then
<p class="centered shift"><em>{{$ev.old_stt_name}} → {{$ev.new_stt_name}}</em></p>
% end
</div>
% end
<details><summary>new comment</summary>
% set action = "/p/" .. $proj.name .. "/t/" .. $tick.code .. "/c"
<form action="{{$action}}" method="post">
<textarea id="text" name="text" required cols="100" rows="5"></textarea>
<br><br>
<input type="submit" value="add comment">
</form>
</details>
</div>
</body>
</html>