From ff653b9a97434ddae64c164618ae5392afcf83fb Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Sun, 1 Nov 2026 16:13:12 -0500 Subject: [PATCH] after priority --- sources/task-list-mockup.html | 67 +++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/sources/task-list-mockup.html b/sources/task-list-mockup.html index 8772f40e..0681fd7d 100644 --- a/sources/task-list-mockup.html +++ b/sources/task-list-mockup.html @@ -281,9 +281,11 @@ border-radius: 50%; flex-shrink: 0; } + /* Three color groups for ObjectPriority's five values: + 0 Highest, 1 High -> high (red); 2 Normal -> normal (orange); 3 Low, 4 Lowest -> low (blue) */ .priority-high .priority-indicator { background: #cb2431; } - .priority-medium .priority-indicator { background: #e67e22; } - .priority-low .priority-indicator { background: #28a745; } + .priority-normal .priority-indicator { background: #e67e22; } + .priority-low .priority-indicator { background: #1e88e5; } .btn-sm { padding: 3px 12px; font-size: 12px; } @@ -497,14 +499,15 @@ Sorting: click a sortable header to toggle ASC/DESC. ?sort=field -> ascending (header shows ▲) ?sort=-field -> descending (header shows ▼) - Clicking a different column starts ascending. Default sort: -date_created (newest first). + Clicking a different column starts ascending. + Status sorts by workflow order (task_status__task_status_sort_order), not alphabetically. Default sort: -date_created (newest first). Each header link keeps all other active query params (filters, page_size). -->
- + @@ -519,13 +522,13 @@ - + - + {% empty %} @@ -533,24 +536,24 @@ - + - + - + - + @@ -561,29 +564,29 @@ - + - + - + - + - + @@ -594,18 +597,18 @@ - + - + - + @@ -616,29 +619,29 @@ - + - + - + - + - + @@ -685,15 +688,16 @@ // 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 + // "+ New Task" needs user_level >= 3; "View" needs user_level >= 1. function applyUserLevel() { - var required = Number(newTaskBtn.dataset.requiresUserLevel); - newTaskBtn.hidden = Number(levelSelect.value) < required; + var level = Number(levelSelect.value); + document.querySelectorAll('[data-requires-user-level]').forEach(function (el) { + el.hidden = level < Number(el.dataset.requiresUserLevel); + }); } levelSelect.addEventListener('change', applyUserLevel); applyUserLevel(); @@ -723,7 +727,10 @@ var sortInput = document.getElementById('sort-input'); var tbody = document.querySelector('.task-table tbody'); var sortHeaders = Array.prototype.slice.call(document.querySelectorAll('.task-table th[data-sort-field]')); - var PRIORITY_RANK = { Low: 1, Medium: 2, High: 3 }; + // ObjectPriority values: ascending puts Highest (0) first + var PRIORITY_RANK = { Highest: 0, High: 1, Normal: 2, Low: 3, Lowest: 4 }; + // ListOfTaskStatus.task_status_sort_order from the seed data + var STATUS_SORT_ORDER = { 'New': 1, 'Backlog': 2, 'Blocked': 3, 'In Progress': 4, 'Test/Review': 5, 'Closed': 6 }; function renderSort() { var sort = sortInput.value; @@ -749,8 +756,8 @@ rows.sort(function (a, b) { var x = a.cells[activeIndex].textContent.trim(); var y = b.cells[activeIndex].textContent.trim(); - var cmp = field === 'task_priority' - ? PRIORITY_RANK[x] - PRIORITY_RANK[y] + var cmp = field === 'task_priority' ? PRIORITY_RANK[x] - PRIORITY_RANK[y] + : field === 'task_status__task_status_sort_order' ? STATUS_SORT_ORDER[x] - STATUS_SORT_ORDER[y] : x.localeCompare(y); return desc ? -cmp : cmp; });
Title Status Status Priority Assignee Project
{{ task.task_short_description }}#T-{{ task.task_id }} {{ task.task_status.task_status }}{{ priority label }}{{ task.get_task_priority_display }} {{ assigned username|default:"-" }} {{ project name }} {{ task.task_start_date|date:"Y-m-d" }} {{ task.task_end_date|date:"Y-m-d" }} {{ task.date_created|date:"Y-m-d" }}View{% if user_level >= 1 %}View{% endif %}
No tasks found
Migrate customer table to new schema#T-1287 In ProgressHighHighest sam.patel Data Migration 2026-10-20 2026-11-14 2026-10-31ViewView
Design new pricing page layout#T-1284 NewMediumNormal - Website Redesign 2026-11-03 2026-11-21 2026-10-30ViewView
Push notification permissions on Android 15#T-12792026-10-13 2026-10-31 2026-10-28ViewView
Review accessibility audit findings#T-1275 Test/ReviewMediumNormal alex.chen Website Redesign 2026-10-06 2026-10-24 2026-10-25ViewView
Add CSV export to admin reports#T-1270 BacklogLowLowest - Internal Tools 2026-11-17 2026-12-05 2026-10-22ViewView
Set up staging environment for v2 beta#T-12662026-09-29 2026-10-10 2026-10-18ViewView
Validate migrated invoice totals#T-1261 Test/ReviewHighHighest riley.ng Data Migration 2026-10-01 2026-10-17 2026-10-15ViewView
Refresh onboarding illustrations#T-12582026-10-12 2026-11-07 2026-10-11ViewView
Clean up unused feature flags#T-1252 BacklogMediumNormal sam.patel Internal Tools 2026-11-24 2026-12-12 2026-10-08ViewView
Offline mode for task checklist#T-1247 NewLowLowest - Mobile App v2 2026-12-01 2026-12-19 2026-10-04ViewView