Development

This commit is contained in:
Matthew Grotke 2026-06-03 15:31:39 -04:00
parent f479e07a90
commit 2140ea0e0a
2 changed files with 12 additions and 2 deletions

View file

@ -108,11 +108,19 @@
"type": "button_row", "type": "button_row",
"justify": "space-between", "justify": "space-between",
"items": [ "items": [
{
"type": "raw_html",
"html": "<label style='display:flex;align-items:center;gap:0.5rem;margin:0;font-size:0.875rem'>Revert behavior:<select name='revert_behavior' class='form-select' style='width:auto'><option value='revert_subsequent'>Revert selected and subsequent tree changes</option><option value='restore_state'>Restore to tree selected state</option></select></label>"
},
{ {
"type": "button_secondary", "type": "button_secondary",
"text": "Revert Selected", "text": "Revert",
"disabled": "%NO_HISTORY%" "disabled": "%NO_HISTORY%"
}, },
{
"type": "raw_html",
"html": "<span style='flex:1'></span>"
},
{ {
"type": "button_danger", "type": "button_danger",
"text": "Clear Selected History", "text": "Clear Selected History",

View file

@ -65,6 +65,8 @@ def collect_tokens(cfg):
done_ts_map = get_done_timestamps() done_ts_map = get_done_timestamps()
if all_groups: if all_groups:
level = client_level()
is_manager = LEVEL_RANK.get(level, 0) >= LEVEL_RANK.get('manager', 0)
no_revert = set() no_revert = set()
for g, _ in all_groups: for g, _ in all_groups:
if g['reverts_group']: if g['reverts_group']:
@ -99,7 +101,7 @@ def collect_tokens(cfg):
'</span></div>' '</span></div>'
) )
snap_user = e(g.get('user', '')) snap_user = e(g.get('user', ''))
cb_attrs = 'disabled title="Cannot revert"' if uuid in no_revert else '' cb_attrs = '' if is_manager else ('disabled title="Cannot revert"' if uuid in no_revert else '')
hist_rows += ( hist_rows += (
f'<tr class="row-expandable" data-uuid="{e(uuid)}" {hist_onclick}>' f'<tr class="row-expandable" data-uuid="{e(uuid)}" {hist_onclick}>'
f'<td class="table-cell"><input type="checkbox" name="selected_uuids" value="{e(uuid)}" {cb_attrs}/></td>' f'<td class="table-cell"><input type="checkbox" name="selected_uuids" value="{e(uuid)}" {cb_attrs}/></td>'