R1 foundation - Phase 1 live build

This commit is contained in:
2026-02-28 03:33:33 +00:00
commit f36ea194f3
45 changed files with 4009 additions and 0 deletions

119
templates/task_form.html Normal file
View File

@@ -0,0 +1,119 @@
{% extends "base.html" %}
{% block content %}
<div class="breadcrumb">
<a href="/tasks">Tasks</a>
<span class="sep">/</span>
<span>{{ 'Edit' if item else 'New Task' }}</span>
</div>
<div class="page-header">
<h1 class="page-title">{{ 'Edit Task' if item else 'New Task' }}</h1>
</div>
<div class="card">
<form method="post" action="{{ '/tasks/' ~ item.id ~ '/edit' if item else '/tasks/create' }}">
<div class="form-grid">
<div class="form-group full-width">
<label class="form-label">Title *</label>
<input type="text" name="title" class="form-input" required
value="{{ item.title if item else '' }}">
</div>
<div class="form-group">
<label class="form-label">Domain *</label>
<select name="domain_id" class="form-select" required>
{% for d in domains %}
<option value="{{ d.id }}"
{{ 'selected' if (item and item.domain_id|string == d.id|string) or (not item and prefill_domain_id == d.id|string) }}>
{{ d.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Project</label>
<select name="project_id" class="form-select">
<option value="">-- No Project --</option>
{% for p in projects %}
<option value="{{ p.id }}"
{{ 'selected' if (item and item.project_id and item.project_id|string == p.id|string) or (not item and prefill_project_id == p.id|string) }}>
{{ p.name }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Priority</label>
<select name="priority" class="form-select">
<option value="1" {{ 'selected' if item and item.priority == 1 }}>1 - Critical</option>
<option value="2" {{ 'selected' if item and item.priority == 2 }}>2 - High</option>
<option value="3" {{ 'selected' if (item and item.priority == 3) or not item }}>3 - Normal</option>
<option value="4" {{ 'selected' if item and item.priority == 4 }}>4 - Low</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Status</label>
<select name="status" class="form-select">
{% for s in ['open', 'in_progress', 'blocked', 'done', 'cancelled'] %}
<option value="{{ s }}" {{ 'selected' if item and item.status == s }}>{{ s|replace('_', ' ')|title }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Due Date</label>
<input type="date" name="due_date" class="form-input"
value="{{ item.due_date if item and item.due_date else '' }}">
</div>
<div class="form-group">
<label class="form-label">Context</label>
<select name="context" class="form-select">
<option value="">-- None --</option>
{% for ct in context_types %}
<option value="{{ ct.value }}"
{{ 'selected' if item and item.context == ct.value }}>{{ ct.label }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label class="form-label">Estimated Minutes</label>
<input type="number" name="estimated_minutes" class="form-input" min="0"
value="{{ item.estimated_minutes if item and item.estimated_minutes else '' }}">
</div>
<div class="form-group">
<label class="form-label">Energy Required</label>
<select name="energy_required" class="form-select">
<option value="">-- None --</option>
<option value="high" {{ 'selected' if item and item.energy_required == 'high' }}>High</option>
<option value="medium" {{ 'selected' if item and item.energy_required == 'medium' }}>Medium</option>
<option value="low" {{ 'selected' if item and item.energy_required == 'low' }}>Low</option>
</select>
</div>
<div class="form-group full-width">
<label class="form-label">Description</label>
<textarea name="description" class="form-textarea">{{ item.description if item and item.description else '' }}</textarea>
</div>
<div class="form-group full-width">
<label class="form-label">Tags (comma-separated)</label>
<input type="text" name="tags" class="form-input"
value="{{ item.tags|join(', ') if item and item.tags else '' }}">
</div>
{% if prefill_parent_id %}
<input type="hidden" name="parent_id" value="{{ prefill_parent_id }}">
{% endif %}
<div class="form-actions">
<button type="submit" class="btn btn-primary">{{ 'Save Changes' if item else 'Create Task' }}</button>
<a href="{{ '/tasks/' ~ item.id if item else '/tasks' }}" class="btn btn-secondary">Cancel</a>
</div>
</div>
</form>
</div>
{% endblock %}