Mass migrate events into new categories

We have a mega-category with over 2000 events, which we’d like to split into sub-categories.

Fortunately the events all follow a standard naming convention: for the better part of a decade we’ve relied on the regular naming to generate filtered indices of each type of event. So it would be trivial if there were a way to select events by name in the management area.

Unfortunately I don’t see a way to do this. Is there one? I could probably contact my local indico admins (there must be an internal way to do it) but I was hoping to do this myself. This is a pretty common situation in my experiment, so a generic solution would be great.

use some JavaScript in the browser dev console to tick the right checkboxes

1 Like

It sounds like it could work. Assuming it’s a serious suggestion any starting point (from anyone who has done similar) would be amazing.

Yes, I literally did that at some point (matching events by name) because it was faster (and less error-prone) than scripting something in the Python indico shell. Unfortunately it’s been a long time ago so it might no longer by in my devtools history… But luckily it was quite easy to recreate from scratch:

[...document.querySelectorAll('.i-table tr input[type=checkbox][name=event_id]')]
  .filter(x =>
    x
      .closest('tr')
      .querySelector('a[href^="/event/"]')
      .innerText.includes('foo')
  )
  .forEach(x => {
    x.checked = true;
    x.dispatchEvent(new Event('change', {bubbles: true}))
  });

This selects all events with foo in the title.

Works like a dream, thanks!