From: Christian Heller <c.heller@plomlompom.de> Date: Mon, 3 Jun 2024 02:22:17 +0000 (+0200) Subject: To Processes listing, add sortable effort column. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7Bprefix%7D%7D/process_descriptions?a=commitdiff_plain;h=0c668bad3efe0db132452b63ecfef05320ca9e48;p=plomtask To Processes listing, add sortable effort column. --- diff --git a/plomtask/http.py b/plomtask/http.py index 8ddef65..249de32 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -269,6 +269,10 @@ class TaskHandler(BaseHTTPRequestHandler): processes.sort(key=lambda p: len(p.explicit_steps)) elif sort_by == '-steps': processes.sort(key=lambda p: len(p.explicit_steps), reverse=True) + elif sort_by == 'effort': + processes.sort(key=lambda p: p.effort.newest) + elif sort_by == '-effort': + processes.sort(key=lambda p: p.effort.newest, reverse=True) elif sort_by == '-title': processes.sort(key=lambda p: p.title.newest, reverse=True) else: diff --git a/templates/processes.html b/templates/processes.html index 9b282bf..42beafc 100644 --- a/templates/processes.html +++ b/templates/processes.html @@ -11,11 +11,13 @@ <table> <tr> <th><a href="?sort_by={% if sort_by == "steps" %}-{% endif %}steps">steps</a></th> +<th><a href="?sort_by={% if sort_by == "effort" %}-{% endif %}effort">effort</a></th> <th><a href="?sort_by={% if sort_by == "title" %}-{% endif %}title">title</a></th> </tr> {% for process in processes %} <tr> <td>{{ process.explicit_steps|count }}</td> +<td>{{ process.effort.newest }}</td> <td><a href="process?id={{process.id_}}">{{process.title.newest}}</a></td> </tr> {% endfor %}