Improve tasks and backdate insights

This commit is contained in:
2026-03-03 17:21:06 +00:00
parent 9c14e51b43
commit 2898d9e832
18 changed files with 1617 additions and 264 deletions

View File

@@ -4,20 +4,130 @@
<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">
<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">
<div class="columns is-variable is-5">
<div class="column is-4">
<article class="box">
<h2 class="title is-6">Projects</h2>
<ul>
<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_identifiers %}
<tr>
<td><code>{{ row.identifier }}</code></td>
<td>{{ row.service }}</td>
<td class="has-text-right">
{% if selected_project %}
{% if tuple(selected_project.id, row.service, row.identifier) in mapping_pairs %}
<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 persons 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 %}
<li><a href="{% url 'tasks_project' project_id=project.id %}">{{ project.name }}</a> <span class="has-text-grey">({{ project.task_count }})</span></li>
<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 %}
<li>No projects yet.</li>
<tr><td colspan="3">No projects yet.</td></tr>
{% endfor %}
</ul>
</tbody>
</table>
</article>
</div>
<div class="column">
@@ -44,4 +154,15 @@
</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 %}