c62810dcb9b6b76fd427ce776219fb5eb02357dd hiram Thu Apr 30 13:18:29 2026 -0700 set the table to class sortable to allow column header sort function refs #31811 diff --git src/hg/utils/otto/userRequests/ottoRequestView.cgi src/hg/utils/otto/userRequests/ottoRequestView.cgi index c0338e31cd9..ce37973303e 100644 --- src/hg/utils/otto/userRequests/ottoRequestView.cgi +++ src/hg/utils/otto/userRequests/ottoRequestView.cgi @@ -135,31 +135,31 @@ '.legend code{background:#eee;padding:0 3px}\n' '</style></head><body>\n') out(f'<h2>{DB}.{TABLE}</h2>\n') if info: out(f'<div class="banner info">{html.escape(info)}</div>\n') if error: out(f'<div class="banner error">{html.escape(error)}</div>\n') out('<div class="legend">status: ') out(' · '.join(f'<code>{k}</code>={html.escape(v)}' for k, v in STATUS_NAMES.items())) out(f' · <b>{len(rows)}</b> row(s) · ' f'<a href="">refresh</a></div>\n') - out('<table>\n<tr>') + out('<table class="sortable">\n<tr>') for c in COLS: out(f'<th>{c}</th>') out('<th>set status</th></tr>\n') for r in rows: rid = r[0] try: stnum = int(r[7]) except (ValueError, IndexError): stnum = -1 cls = f's{stnum}' if stnum in (7, 8) else '' out(f'<tr class="{cls}">') for i, c in enumerate(COLS): cell = r[i] if i < len(r) else '' if c == 'comment': @@ -170,32 +170,33 @@ f'<small>{html.escape(label)}</small></td>') else: out(f'<td>{html.escape(cell)}</td>') # reset form out('<td><form method="post" ' 'onsubmit="return confirm(\'Reset status of id=' + html.escape(rid) + ' to \' + this.status.value + \'?\')">' '<input type="hidden" name="action" value="resetStatus">' f'<input type="hidden" name="id" value="{html.escape(rid)}">' '<select name="status">') for k in sorted(STATUS_NAMES): sel = ' selected' if k == stnum else '' out(f'<option value="{k}"{sel}>{k}</option>') out('</select> <button type="submit">set</button></form></td>') out('</tr>\n') - out('</table>\n</body></html>\n') - + out('</table>\n') + out('<script src="/js/sorttable.js"></script>\n') + out('</body></html>\n') def main(): checkIp() info = error = None if os.environ.get('REQUEST_METHOD', 'GET') == 'POST': form = cgi.FieldStorage() action = form.getfirst('action', '') if action == 'resetStatus': info, error = doResetStatus(form) else: error = f"unknown action: {action!r}" try: rows = fetchRows()