cuny-academic-commons / commons-in-a-box

Commons In A Box - A suite of community and collaboration tools for WordPress, designed especially for academic communities
http://commonsinabox.org
72 stars 14 forks source link

Allow admins to determine order for site templates #471

Closed boonebgorges closed 1 week ago

boonebgorges commented 2 months ago

After some discussion with the City Tech team, we think the most obvious place to do this by making the elements on Dashboard > Site Templates sortable via drag-and-drop.

boonebgorges commented 2 months ago

I've built a version of this. I wanted to avoid using a secondary plugin for drag-and-drop: too much overhead, too many features, too much potential for breakage. So I built my own drag-and-drop implementation. It's not extremely polished, but I added a few little transition effects that I think make it usable. See gif:

Peek 2024-05-02 14-57

bree-z commented 1 month ago

Thanks Boone! Drag-and-drop looks good, and the order that templates appear on the front end are changed based on the order determined in the Dashboard.

There's just one minor quirk I've found. Sometimes after I drag a template, the title of the template remains light blue. I can't reliably reproduce it, and it goes away after I reload the page.

Screen Shot 2024-05-29 at 4 12 40 AM
boonebgorges commented 1 month ago

The light-blue issue appears to happen when you grab by the link text rather than elsewhere in the row. I've just pushed up a fix.

bree-z commented 2 weeks ago

Thanks Boone. Currently, I'm not able to grab the title or any other part of an element. I tested using Chrome and Firefox.

2024-06-18_14-33-28 (1)

boonebgorges commented 2 weeks ago

This was caused by some interference caused by #472. It should now be fixed.

bree-z commented 1 week ago

This looks good, thanks!