Files
project-work/sources/task-list-mockup.html

367 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Task List Mockup</title>
<style>
:root {
--page-bg: #f6f8fa;
--surface: #ffffff;
--text: #24292e;
--text-muted: #6a737d;
--border: #e1e4e8;
--primary: #0366d6;
--primary-hover: #0256b9;
--secondary-bg: #fafbfc;
--secondary-hover: #f3f4f6;
--demo-bg: #fff8c5;
--demo-border: #d4a72c;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--page-bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
}
/* ---------- Mockup-only controls (not part of the real UI) ---------- */
.demo-bar {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 16px;
padding: 8px 16px;
background: var(--demo-bg);
border-bottom: 1px solid var(--demo-border);
font-size: 13px;
}
.demo-bar strong { font-weight: 600; }
.demo-bar select { padding: 2px 6px; font-size: 13px; }
.demo-output {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
word-break: break-all;
}
/* ---------- Page ---------- */
.page {
max-width: 1400px;
margin: 0 auto;
padding: 16px;
}
/* Header bar */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding-bottom: 16px;
margin-bottom: 16px;
border-bottom: 1px solid var(--border);
}
.page-header h1 {
margin: 0;
font-size: 24px;
font-weight: 600;
}
/* Two-column layout: sidebar left, table right; stacks below 1024px */
.layout {
display: grid;
grid-template-columns: 280px 1fr;
gap: 16px;
align-items: start;
}
@media (max-width: 1023.98px) {
.layout { grid-template-columns: 1fr; }
}
/* ---------- Buttons & form controls ---------- */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 6px 16px;
border: 1px solid transparent;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
line-height: 20px;
text-decoration: none;
cursor: pointer;
white-space: nowrap;
}
.btn-primary {
background: var(--primary);
border-color: var(--primary);
color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
background: var(--secondary-bg);
border-color: var(--border);
color: var(--text);
}
.btn-secondary:hover { background: var(--secondary-hover); }
.form-control {
display: block;
width: 100%;
padding: 6px 8px;
border: 1px solid var(--border);
border-radius: 6px;
background: var(--surface);
color: var(--text);
font-size: 14px;
font-family: inherit;
}
.form-control:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.2);
}
/* ---------- Sidebar filters ---------- */
.sidebar {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
padding: 16px;
}
.filter-section + .filter-section {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid var(--border);
}
.filter-label {
display: block;
margin: 0 0 8px;
padding: 0;
font-size: 13px;
font-weight: 600;
}
fieldset.filter-section {
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
border-left: 0;
border-right: 0;
border-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-bottom: 0;
}
fieldset.filter-section:first-child { border-top: 0; padding-top: 0; }
.checkbox-list {
display: flex;
flex-direction: column;
gap: 4px;
}
.checkbox-list label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
}
.date-field + .date-field { margin-top: 8px; }
.date-field span {
display: block;
margin-bottom: 4px;
font-size: 12px;
color: var(--text-muted);
}
.filter-actions {
display: flex;
gap: 8px;
}
.filter-actions .btn { flex: 1; }
/* ---------- Main area (placeholder until specified) ---------- */
.main {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
min-height: 320px;
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
}
.placeholder {
color: var(--text-muted);
text-align: center;
border: 2px dashed var(--border);
border-radius: 6px;
padding: 32px 16px;
width: 100%;
}
</style>
</head>
<body>
<!-- =====================================================================
MOCKUP-ONLY CONTROLS — not part of the real UI. Remove when building.
===================================================================== -->
<div class="demo-bar" role="region" aria-label="Mockup controls">
<strong>Mockup controls</strong>
<label>
Simulated user_level:
<select id="demo-user-level">
<option value="0">0 – no access</option>
<option value="1">1 – read</option>
<option value="2">2 – edit</option>
<option value="3">3 – create</option>
<option value="4" selected>4 – full</option>
</select>
</label>
<span>Last submitted query: <span class="demo-output" id="demo-query">(none)</span></span>
</div>
<div class="page">
<!-- Header bar -->
<header class="page-header">
<h1>All Tasks</h1>
<!-- {% if user_level >= 3 %} -->
<a href="/new_task/" class="btn btn-primary" id="new-task-btn" data-requires-user-level="3">+ New Task</a>
<!-- {% endif %} -->
</header>
<div class="layout">
<!-- ================= Sidebar filters ================= -->
<aside class="sidebar" aria-label="Filters">
<!-- All filters in a single GET form; selections appear in the URL query string. -->
<form method="get" action="/tasks/" id="task-filter-form">
<!-- 1. Status — multi-select checkboxes; values come from ListOfTaskStatus -->
<fieldset class="filter-section">
<legend class="filter-label">Status</legend>
<div class="checkbox-list">
<!-- {% for status in status_options %} -->
<label><input type="checkbox" name="status" value="new"> New</label>
<label><input type="checkbox" name="status" value="backlog"> Backlog</label>
<label><input type="checkbox" name="status" value="blocked"> Blocked</label>
<label><input type="checkbox" name="status" value="in_progress"> In Progress</label>
<label><input type="checkbox" name="status" value="test_review"> Test/Review</label>
<label><input type="checkbox" name="status" value="closed"> Closed</label>
<!-- {% endfor %} -->
</div>
</fieldset>
<!-- 2. Assignee — "All Assignees" + users with task access in the
current user's accessible projects + "Unassigned" -->
<div class="filter-section">
<label class="filter-label" for="filter-assignee">Assignee</label>
<select class="form-control" id="filter-assignee" name="assignee">
<option value="">All Assignees</option>
<!-- {% for user in assignee_options %} -->
<option value="alex.chen">alex.chen</option>
<option value="jordan.lee">jordan.lee</option>
<option value="riley.ng">riley.ng</option>
<option value="sam.patel">sam.patel</option>
<option value="taylor.kim">taylor.kim</option>
<!-- {% endfor %} -->
<option value="unassigned">Unassigned</option>
</select>
</div>
<!-- 3. Project — "All Projects" + projects the user has
ObjectAssignment access to (via their groups) -->
<div class="filter-section">
<label class="filter-label" for="filter-project">Project</label>
<select class="form-control" id="filter-project" name="project">
<option value="">All Projects</option>
<!-- {% for project in project_options %} -->
<option value="1">Website Redesign</option>
<option value="2">Mobile App v2</option>
<option value="3">Data Migration</option>
<option value="4">Internal Tools</option>
<!-- {% endfor %} -->
</select>
</div>
<!-- 4. Date Range — both optional, independently
Start Date: task_start_date >= value
End Date: task_end_date <= value -->
<fieldset class="filter-section">
<legend class="filter-label">Date Range</legend>
<label class="date-field">
<span>Start Date</span>
<input class="form-control" type="date" name="start_date">
</label>
<label class="date-field">
<span>End Date</span>
<input class="form-control" type="date" name="end_date">
</label>
</fieldset>
<!-- 5. Actions -->
<div class="filter-section">
<div class="filter-actions">
<!-- Link (not a reset button) so all query params are cleared -->
<a href="/tasks/" class="btn btn-secondary" id="clear-filters">Clear Filters</a>
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</div>
</form>
</aside>
<!-- ================= Main table area ================= -->
<main class="main">
<div class="placeholder">
Main table area — to be specified<br>
(results header, columns, sorting, pagination)
</div>
</main>
</div>
</div>
<script>
// Mockup-only behaviour. The real page relies on the server for all of this.
(function () {
var levelSelect = document.getElementById('demo-user-level');
var newTaskBtn = document.getElementById('new-task-btn');
var form = document.getElementById('task-filter-form');
var clearLink = document.getElementById('clear-filters');
var queryOut = document.getElementById('demo-query');
// "+ New Task" visible only when user_level >= 3
function applyUserLevel() {
var required = Number(newTaskBtn.dataset.requiresUserLevel);
newTaskBtn.hidden = Number(levelSelect.value) < required;
}
levelSelect.addEventListener('change', applyUserLevel);
applyUserLevel();
// Standalone file has no server: show the GET URL instead of navigating.
form.addEventListener('submit', function (e) {
e.preventDefault();
var params = new URLSearchParams();
new FormData(form).forEach(function (value, key) {
if (value !== '') params.append(key, value);
});
var qs = params.toString();
queryOut.textContent = form.getAttribute('action') + (qs ? '?' + qs : '');
});
clearLink.addEventListener('click', function (e) {
e.preventDefault();
form.reset();
queryOut.textContent = clearLink.getAttribute('href');
});
})();
</script>
</body>
</html>