<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{$title}}</title>
<style>
.centered { text-align: center; }
.menu a { margin: 7px; }
% include view/board.css
</style>
</head>
<body>
<div class="centered menu">
% if $proj == nil then
% set proj_name = "global"
% set from = "home"
<a href="/p">projects</a>
<a href="/i">invites</a>
% else
% set proj_name = $proj.name
% set from = "proj"
<a href="/p/{{$proj.name}}/t/new">new ticket</a>
<a href="/p/{{$proj.name}}/a">archive</a>
% end
</div>
<br>
<h1 class="centered">{{$proj_name}} board</h1>
<div class="kanban-board">
% set state_id = 1
% for column in $columns do
<div class="kanban-column">
<h2 class="centered">{{$states[$state_id]}}</h2>
% for card in $column do
<div class="kanban-card" style="border-color: {{$card.proj_color}};">
<div>
% if $proj == nil then
<a href="/p/{{$card.proj_name}}">{{$card.proj_name}}</a>
% end
<a href="/p/{{$card.proj_name}}/t/{{$card.code}}">#{{$card.code}}</a>
</div>
<p>{{$card.title}}</p>
<div>
{{os.date("%F %R", $card.time)}}
({{$card.priority}})
</div>
<div class="buttons">
% set base_path = "/p/"..$card.proj_name.."/t/"..$card.code
% set shift_path = $base_path.."/shift/"
% set lpath = $shift_path..($state_id-1)
% set rpath = $shift_path..($state_id+1)
% set archive_path = $base_path.."/archive"
% if $state_id == 1 then
% set lpath = $archive_path
% end
% if $state_id == #$states then
% set rpath = $archive_path
% end
<form action="{{$lpath}}?from={{$from}}" method="post">
<button type="submit">←</button>
</form>
<form action="{{$rpath}}?from={{$from}}" method="post">
<button type="submit">→</button>
</form>
</div>
</div>
% end
</div>
% set state_id = $state_id + 1
% end
</div>
</body>
</html>