169 lines
7.8 KiB
HTML
169 lines
7.8 KiB
HTML
{% extends "base.html" %}
|
||
{% block content %}
|
||
<section class="section">
|
||
<div class="container">
|
||
<h1 class="title is-4">Tasks</h1>
|
||
<p class="subtitle is-6">Immutable tasks derived from chat activity.</p>
|
||
<div class="buttons" style="margin-bottom: 0.75rem;">
|
||
<a class="button is-small is-link is-light" href="{% url 'tasks_settings' %}">Task Settings</a>
|
||
</div>
|
||
<div class="columns is-variable is-5">
|
||
<div class="column is-4">
|
||
<article class="box">
|
||
<div class="is-flex is-justify-content-space-between is-align-items-center" style="gap: 0.5rem; margin-bottom: 0.6rem;">
|
||
<h2 class="title is-6" style="margin: 0;">Projects</h2>
|
||
<span class="tag task-stat-tag">{{ projects|length }}</span>
|
||
</div>
|
||
<p class="help" style="margin-bottom: 0.45rem;">Create the project first, then map linked identifiers below in one click.</p>
|
||
<form method="post" style="margin-bottom: 0.75rem;">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="action" value="project_create">
|
||
<input type="hidden" name="person" value="{{ scope.person_id }}">
|
||
<input type="hidden" name="service" value="{{ scope.service }}">
|
||
<input type="hidden" name="identifier" value="{{ scope.identifier }}">
|
||
<div class="field has-addons">
|
||
<div class="control is-expanded">
|
||
<input class="input is-small" name="name" placeholder="New project name">
|
||
</div>
|
||
<div class="control">
|
||
<button class="button is-small is-link is-light" type="submit">Add</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
|
||
{% if scope.person %}
|
||
<article class="message is-light" style="margin-bottom: 0.75rem;">
|
||
<div class="message-body is-size-7">
|
||
Setup scope: <strong>{{ scope.person.name }}</strong>
|
||
{% if scope.service and scope.identifier %}
|
||
· {{ scope.service }} · {{ scope.identifier }}
|
||
{% endif %}
|
||
</div>
|
||
</article>
|
||
<div style="margin-bottom: 0.75rem;">
|
||
<label class="label is-size-7">Map Linked Identifiers To Project</label>
|
||
<form method="get">
|
||
<input type="hidden" name="person" value="{{ scope.person_id }}">
|
||
<input type="hidden" name="service" value="{{ scope.service }}">
|
||
<input type="hidden" name="identifier" value="{{ scope.identifier }}">
|
||
<div class="field has-addons">
|
||
<div class="control is-expanded">
|
||
<div class="select is-small is-fullwidth">
|
||
<select name="project">
|
||
<option value="">Select project</option>
|
||
{% for project in projects %}
|
||
<option value="{{ project.id }}" {% if selected_project and selected_project.id == project.id %}selected{% endif %}>{{ project.name }}</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="control">
|
||
<button class="button is-small is-light" type="submit">Select</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<table class="table is-fullwidth is-striped is-size-7" style="margin-bottom:0.9rem;">
|
||
<thead><tr><th>Identifier</th><th>Service</th><th></th></tr></thead>
|
||
<tbody>
|
||
{% for row in person_identifier_rows %}
|
||
<tr>
|
||
<td><code>{{ row.identifier }}</code></td>
|
||
<td>{{ row.service }}</td>
|
||
<td class="has-text-right">
|
||
{% if selected_project %}
|
||
{% if row.mapped %}
|
||
<span class="tag task-stat-tag">Linked</span>
|
||
{% else %}
|
||
<form method="post">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="action" value="project_map_identifier">
|
||
<input type="hidden" name="project_id" value="{{ selected_project.id }}">
|
||
<input type="hidden" name="person_identifier_id" value="{{ row.id }}">
|
||
<input type="hidden" name="person" value="{{ scope.person_id }}">
|
||
<input type="hidden" name="service" value="{{ scope.service }}">
|
||
<input type="hidden" name="identifier" value="{{ scope.identifier }}">
|
||
<button class="button is-small is-light" type="submit">Link</button>
|
||
</form>
|
||
{% endif %}
|
||
{% else %}
|
||
<span class="has-text-grey">Select project</span>
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr><td colspan="3">No linked identifiers for this person yet.</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="help" style="margin-bottom: 0.75rem;">
|
||
Open this page from Compose to map a person’s linked identifiers in one click.
|
||
</p>
|
||
{% endif %}
|
||
|
||
<table class="table is-fullwidth is-striped is-size-7">
|
||
<thead><tr><th>Project</th><th>Stats</th><th></th></tr></thead>
|
||
<tbody>
|
||
{% for project in projects %}
|
||
<tr>
|
||
<td>
|
||
<a href="{% url 'tasks_project' project_id=project.id %}">{{ project.name }}</a>
|
||
</td>
|
||
<td>
|
||
<span class="tag task-stat-tag">{{ project.task_count }} task{{ project.task_count|pluralize }}</span>
|
||
<span class="tag task-stat-tag">{{ project.epic_count }} epic{{ project.epic_count|pluralize }}</span>
|
||
</td>
|
||
<td class="has-text-right">
|
||
<form method="post">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="action" value="project_delete">
|
||
<input type="hidden" name="project_id" value="{{ project.id }}">
|
||
<button class="button is-small is-danger is-light" type="submit">Delete</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr><td colspan="3">No projects yet.</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</article>
|
||
</div>
|
||
<div class="column">
|
||
<article class="box">
|
||
<h2 class="title is-6">Recent Derived Tasks</h2>
|
||
<table class="table is-fullwidth is-striped is-size-7">
|
||
<thead><tr><th>Ref</th><th>Title</th><th>Project</th><th>Status</th><th></th></tr></thead>
|
||
<tbody>
|
||
{% for row in tasks %}
|
||
<tr>
|
||
<td>#{{ row.reference_code }}</td>
|
||
<td>{{ row.title }}</td>
|
||
<td>{{ row.project.name }}{% if row.epic %} / {{ row.epic.name }}{% endif %}</td>
|
||
<td>{{ row.status_snapshot }}</td>
|
||
<td><a class="button is-small is-light" href="{% url 'tasks_task' task_id=row.id %}">Open</a></td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr><td colspan="5">No derived tasks yet.</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<style>
|
||
.task-stat-tag {
|
||
background: #f5f5f5;
|
||
border: 1px solid #dbdbdb;
|
||
color: #1f1f1f !important;
|
||
font-size: 0.75rem;
|
||
line-height: 1.5;
|
||
padding: 0.25em 0.75em;
|
||
font-weight: 500;
|
||
}
|
||
</style>
|
||
{% endblock %}
|