login

<!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>
  % 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 shift_path = "/p/"..$card.proj_name.."/t/"..$card.code.."/shift/"
          % set left_disabled = ""
          % if $state_id == 1 then
            % set left_disabled = " disabled"
          % end
          <form action="{{$shift_path}}{{$state_id-1}}?from={{$from}}" method="post">
            <button type="submit"{{$left_disabled}}>←</button>
          </form>
          % set right_disabled = ""
          % if $state_id == #$states then
            % set right_disabled = " disabled"
          % end
          <form action="{{$shift_path}}{{$state_id+1}}?from={{$from}}" method="post">
            <button type="submit"{{$right_disabled}}>→</button>
          </form>
        </div>
      </div>
      % end
    </div>
    % set state_id = $state_id + 1
    % end
  </div>
</body>
</html>