OXYGENHUB
◆ v0.8.0 oxygenhub / templates / project.html
7.3 KiB · HTML · last changed Boards that keep growing stay readable (refs #293) 11 days ago source blame history raw
e1ec9fbf Andy McCall ↶ 1
{% extends "base.html" %}
2
{% block title %}{{ project.title }} · Projects · {{ project.owner }}{% endblock %}
3
{% block mainclass %} class="wide"{% endblock %}
4
{% block content %}
5
<div class="head"><h1>{{ project.title }} <small><a href="/projects/{{ project.owner }}">{{ project.owner }}'s projects</a> · #{{ project.number }}{% if !project.public %} · private{% endif %}{% if project.closed %} · closed{% endif %}</small></h1>
6
{% if !project.description.is_empty() %}<p class="mute">{{ project.description }}</p>{% endif %}</div>
7
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
8
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
657e7d5c Andy McCall ↶ 9
<form class="board-filter" method="get" action="/projects/{{ project.owner }}/{{ project.number }}" role="search">
10
  <label class="visually-hidden" for="board-q">Filter cards</label><input type="search" id="board-q" name="q" value="{{ q }}" placeholder="filter cards">
11
  <label class="visually-hidden" for="board-state">State</label><select id="board-state" name="state"><option value="">any state</option>{% for s in ["open", "closed", "landed", "draft"] %}<option{% if state == *s %} selected{% endif %}>{{ s }}</option>{% endfor %}</select>
12
  <button type="submit" class="small">FILTER</button>{% if filtered %} <a class="small" href="/projects/{{ project.owner }}/{{ project.number }}">clear</a>{% endif %}
13
</form>
e1ec9fbf Andy McCall ↶ 14
<div class="board" role="list" aria-label="Columns">
15
{% for col in columns %}
16
<section class="board-col" role="listitem" aria-labelledby="col-{{ col.column.id }}">
657e7d5c Andy McCall ↶ 17
  <header><h2 id="col-{{ col.column.id }}">{{ col.column.name }} <span class="count-chip">{% if filtered %}{{ col.cards.len() }} of {{ col.total }}{% else %}{{ col.total }}{% endif %}</span></h2>
e1ec9fbf Andy McCall ↶ 18
  {% if can_edit %}<form class="tiny" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="column" value="{{ col.column.id }}"><button name="action" value="left" title="Move the column left" aria-label="Move {{ col.column.name }} left">←</button><button name="action" value="right" title="Move the column right" aria-label="Move {{ col.column.name }} right">→</button></form>{% endif %}</header>
657e7d5c Andy McCall ↶ 19
  {% if col.hidden > 0 && !filtered %}<p class="small mute col-hidden">{{ col.hidden }} older card{% if col.hidden != 1 %}s{% endif %} not shown · <a href="/projects/{{ project.owner }}/{{ project.number }}?all={{ col.column.id }}#col-{{ col.column.id }}">show all {{ col.total }}</a></p>{% endif %}
e1ec9fbf Andy McCall ↶ 20
  <ul class="cards">
21
  {% for c in col.cards %}
22
    <li class="card-item{% if c.card.kind == "note" %} note{% endif %}">
23
      {% if c.card.kind == "note" %}<p>{{ c.title }}</p>
24
      {% else %}<a href="{{ c.url }}">{{ c.title }}</a>
25
      <p class="small mute"><span class="glyph" aria-hidden="true">{% if c.card.kind == "issue" %}◇{% else %}⇄{% endif %}</span> {{ c.reference }} · <span class="state-{{ c.state }}">{{ c.state }}</span></p>{% endif %}
26
      {% if can_edit %}
27
      <form class="tiny card-actions" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="card" value="{{ c.card.id }}">
28
        <label class="visually-hidden" for="mv-{{ c.card.id }}">Column</label>
29
        <select id="mv-{{ c.card.id }}" name="column">{% for o in columns %}<option value="{{ o.column.id }}"{% if o.column.id == col.column.id %} selected{% endif %}>{{ o.column.name }}</option>{% endfor %}</select>
30
        <button name="action" value="move">move</button><button name="action" value="up" aria-label="Up">↑</button><button name="action" value="down" aria-label="Down">↓</button><button name="action" value="remove" aria-label="Remove from the project">✕</button>
31
      </form>{% endif %}
32
    </li>
33
  {% endfor %}
34
  </ul>
35
  {% if can_edit %}
36
  <details class="add-card"><summary class="small">add a card</summary>
37
    <form method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="column" value="{{ col.column.id }}"><input type="hidden" name="action" value="add">
38
      <label for="ref-{{ col.column.id }}">Issue or proposal</label>
39
      <div class="inline-fields"><select name="repo" aria-label="Repository">{% for r in repos %}<option>{{ r }}</option>{% endfor %}</select><input type="text" id="ref-{{ col.column.id }}" name="reference" placeholder="#12 or repo#12"></div>
40
      <label for="note-{{ col.column.id }}">or a note</label><textarea id="note-{{ col.column.id }}" name="note" rows="2" maxlength="500"></textarea>
41
      <button type="submit" class="small">ADD</button>
42
    </form>
43
  </details>
44
  <details class="add-card"><summary class="small">column</summary>
45
    <form method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="column" value="{{ col.column.id }}">
a7aa76ac Andy McCall 46
      <input type="text" name="name" value="{{ col.column.name }}" aria-label="Column name" maxlength="40"><button name="action" value="rename_column" class="small">RENAME</button> <button name="action" value="remove_column" class="small danger-btn" data-confirm="Remove this column? Its cards move to the first column.">REMOVE</button>
e1ec9fbf Andy McCall ↶ 47
    </form>
48
  </details>
49
  {% endif %}
50
</section>
51
{% endfor %}
52
{% if can_edit %}
53
<section class="board-col add-col"><form method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><label for="newcol">New column</label><input type="text" id="newcol" name="name" maxlength="40" required><button name="action" value="add_column" class="small">ADD COLUMN</button></form></section>
54
{% endif %}
55
</div>
56
{% if can_manage %}
57
<details class="panel"><summary>Settings</summary>
58
<form class="card" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">
59
  <label for="ptitle">Title</label><input type="text" id="ptitle" name="title" value="{{ project.title }}" maxlength="100">
60
  <label for="pdesc">Description</label><input type="text" id="pdesc" name="description" value="{{ project.description }}">
61
  <div class="choice"><label><input type="checkbox" name="private" value="1"{% if !project.public %} checked{% endif %}> private</label> <label><input type="checkbox" name="closed" value="1"{% if project.closed %} checked{% endif %}> closed (read-only)</label></div>
a7aa76ac Andy McCall 62
  <button name="action" value="settings">SAVE</button> <button name="action" value="delete" class="danger-btn" data-confirm="Delete this project? Issues and proposals are not touched.">DELETE PROJECT</button>
b1e92a62 Andy McCall ↶ 63
</form>
64
{% if !transfer_to.is_empty() %}
65
<form class="card" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">
66
  <h3>Transfer</h3>
67
  <p class="small mute">Move this project to another owner. It takes the next number there, with its columns and cards; this address goes on redirecting to it.</p>
68
  <label for="pto">New owner</label>
69
  <select id="pto" name="to">{% for o in transfer_to %}<option value="{{ o }}">{{ o }}</option>{% endfor %}</select>
a7aa76ac Andy McCall 70
  <button name="action" value="transfer" data-confirm="Transfer this project?">TRANSFER</button>
b1e92a62 Andy McCall ↶ 71
</form>
72
{% endif %}
73
</details>
e1ec9fbf Andy McCall ↶ 74
{% endif %}
75
{% endblock %}