OXYGENHUB
# 0cd118748131 oxygenhub / templates / project.html
6.3 KiB · HTML · last changed Transfer a project to another owner 25 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 %}
9
<div class="board" role="list" aria-label="Columns">
10
{% for col in columns %}
11
<section class="board-col" role="listitem" aria-labelledby="col-{{ col.column.id }}">
12
  <header><h2 id="col-{{ col.column.id }}">{{ col.column.name }} <span class="count-chip">{{ col.cards.len() }}</span></h2>
13
  {% 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>
14
  <ul class="cards">
15
  {% for c in col.cards %}
16
    <li class="card-item{% if c.card.kind == "note" %} note{% endif %}">
17
      {% if c.card.kind == "note" %}<p>{{ c.title }}</p>
18
      {% else %}<a href="{{ c.url }}">{{ c.title }}</a>
19
      <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 %}
20
      {% if can_edit %}
21
      <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 }}">
22
        <label class="visually-hidden" for="mv-{{ c.card.id }}">Column</label>
23
        <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>
24
        <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>
25
      </form>{% endif %}
26
    </li>
27
  {% endfor %}
28
  </ul>
29
  {% if can_edit %}
30
  <details class="add-card"><summary class="small">add a card</summary>
31
    <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">
32
      <label for="ref-{{ col.column.id }}">Issue or proposal</label>
33
      <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>
34
      <label for="note-{{ col.column.id }}">or a note</label><textarea id="note-{{ col.column.id }}" name="note" rows="2" maxlength="500"></textarea>
35
      <button type="submit" class="small">ADD</button>
36
    </form>
37
  </details>
38
  <details class="add-card"><summary class="small">column</summary>
39
    <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 }}">
40
      <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" onclick="return confirm('Remove this column? Its cards move to the first column.')">REMOVE</button>
41
    </form>
42
  </details>
43
  {% endif %}
44
</section>
45
{% endfor %}
46
{% if can_edit %}
47
<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>
48
{% endif %}
49
</div>
50
{% if can_manage %}
51
<details class="panel"><summary>Settings</summary>
52
<form class="card" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">
53
  <label for="ptitle">Title</label><input type="text" id="ptitle" name="title" value="{{ project.title }}" maxlength="100">
54
  <label for="pdesc">Description</label><input type="text" id="pdesc" name="description" value="{{ project.description }}">
55
  <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>
56
  <button name="action" value="settings">SAVE</button> <button name="action" value="delete" class="danger-btn" onclick="return confirm('Delete this project? Issues and proposals are not touched.')">DELETE PROJECT</button>
b1e92a62 Andy McCall ↶ 57
</form>
58
{% if !transfer_to.is_empty() %}
59
<form class="card" method="post" action="/projects/{{ project.owner }}/{{ project.number }}"><input type="hidden" name="_csrf" value="{{ shell.csrf }}">
60
  <h3>Transfer</h3>
61
  <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>
62
  <label for="pto">New owner</label>
63
  <select id="pto" name="to">{% for o in transfer_to %}<option value="{{ o }}">{{ o }}</option>{% endfor %}</select>
64
  <button name="action" value="transfer" onclick="return confirm('Transfer this project?')">TRANSFER</button>
65
</form>
66
{% endif %}
67
</details>
e1ec9fbf Andy McCall ↶ 68
{% endif %}
69
{% endblock %}