diff --git a/assets/js/boorujs.js b/assets/js/boorujs.js index 666c30053..3d5ab9204 100644 --- a/assets/js/boorujs.js +++ b/assets/js/boorujs.js @@ -38,6 +38,8 @@ const actions = { selectvalue(data) { document.querySelector(data.value).value = data.el.querySelector(':checked').dataset.setValue; }, + checkall(data) { $$(`${data.value} input[type=checkbox]`).forEach(c => { c.checked = !c.checked; }) }, + focus(data) { document.querySelector(data.value).focus(); }, preventdefault() { /* The existence of this entry is enough */ }, diff --git a/lib/philomena_web/templates/tag_change/index.html.slime b/lib/philomena_web/templates/tag_change/index.html.slime index 5fef9aca9..3e5961b64 100644 --- a/lib/philomena_web/templates/tag_change/index.html.slime +++ b/lib/philomena_web/templates/tag_change/index.html.slime @@ -1,7 +1,13 @@ .block__header = @pagination -= form_for :tag_changes, Routes.tag_change_revert_path(@conn, :create), fn _f -> += if reverts_tag_changes?(@conn) do + .block__header.block__header--light.block__header--sub + a data-click-checkall=".tag-changes-form" + i.fa.fa-check> + ' Toggle all + += form_for :tag_changes, Routes.tag_change_revert_path(@conn, :create), [class: "tag-changes-form"], fn _f -> .block__content table.table thead