205 lines
11 KiB
HTML
205 lines
11 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' %}{% if scope.person_id or scope.service or scope.identifier %}?{% if scope.person_id %}person={{ scope.person_id|urlencode }}{% endif %}{% if scope.service %}{% if scope.person_id %}&{% endif %}service={{ scope.service|urlencode }}{% endif %}{% if scope.identifier %}{% if scope.person_id or scope.service %}&{% endif %}identifier={{ scope.identifier|urlencode }}{% endif %}{% endif %}">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-ui-badge">{{ projects|length }}</span>
|
||
</div>
|
||
<p class="help" style="margin-bottom: 0.45rem;">Projects are created automatically from chat usage. Use this panel for manual cleanup and mapping.</p>
|
||
<div class="buttons" style="margin-bottom:0.55rem;">
|
||
{% if show_empty_projects %}
|
||
<a class="button is-small is-light" href="{% url 'tasks_hub' %}">Hide empty projects</a>
|
||
{% else %}
|
||
<a class="button is-small is-light" href="{% url 'tasks_hub' %}?show_empty=1">Show empty projects</a>
|
||
{% endif %}
|
||
</div>
|
||
<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 project_choices %}
|
||
<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-ui-badge">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-ui-badge">{{ project.task_count }} task{{ project.task_count|pluralize }}</span>
|
||
<span class="tag task-ui-badge">{{ project.epic_count }} epic{{ project.epic_count|pluralize }}</span>
|
||
</td>
|
||
<td class="has-text-right">
|
||
<form method="post" onsubmit="const v=prompt('Type {{ project.name|escapejs }} to confirm delete'); if(v===null){return false;} this.confirm_name.value=v; return true;">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="action" value="project_delete">
|
||
<input type="hidden" name="project_id" value="{{ project.id }}">
|
||
<input type="hidden" name="confirm_name" value="">
|
||
<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>Created By</th><th>Project</th><th>Status</th><th>Actions</th></tr></thead>
|
||
<tbody>
|
||
{% for row in tasks %}
|
||
<tr>
|
||
<td>#{{ row.reference_code }}</td>
|
||
<td>{{ row.title }}</td>
|
||
<td>
|
||
{{ row.creator_label|default:"Unknown" }}
|
||
{% if row.creator_identifier %}
|
||
<div class="has-text-grey"><code>{{ row.creator_identifier }}</code></div>
|
||
{% endif %}
|
||
</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>
|
||
{% if enabled_providers|length == 1 %}
|
||
<form method="post" action="{% url 'tasks_codex_submit' %}" style="display:inline;">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="task_id" value="{{ row.id }}">
|
||
<input type="hidden" name="next" value="{% url 'tasks_hub' %}">
|
||
<input type="hidden" name="provider" value="{{ enabled_providers.0 }}">
|
||
<button class="button is-small is-link is-light" type="submit">
|
||
Send to {% if enabled_providers.0 == "claude_cli" %}Claude{% else %}Codex{% endif %}
|
||
</button>
|
||
</form>
|
||
{% elif enabled_providers %}
|
||
<form method="post" action="{% url 'tasks_codex_submit' %}" style="display:inline;">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="task_id" value="{{ row.id }}">
|
||
<input type="hidden" name="next" value="{% url 'tasks_hub' %}">
|
||
<div class="field has-addons" style="display:inline-flex;">
|
||
<div class="control">
|
||
<div class="select is-small">
|
||
<select name="provider">
|
||
{% for p in enabled_providers %}
|
||
<option value="{{ p }}">{% if p == "claude_cli" %}Claude{% else %}Codex{% endif %}</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="control">
|
||
<button class="button is-small is-link is-light" type="submit">Send</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr><td colspan="6">No derived tasks yet.</td></tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
{% endblock %}
|