home · contact · privacy
To Processes listing, add sortable effort column.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 3 Jun 2024 02:22:17 +0000 (04:22 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 3 Jun 2024 02:22:17 +0000 (04:22 +0200)
plomtask/http.py
templates/processes.html

index 8ddef656be0c8ab23c8e3fe8fa82b66005912cd5..249de3286c946464d98c458118c06517206aafb9 100644 (file)
@@ -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:
index 9b282bf7def6558368961b9236810acd96e342f0..42beafcdffce9458388b35f3cdbcda0bbee07224 100644 (file)
 <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 %}