Toggle for Public Sites in Course Directory
Adding this ticket following up the commons meeting today. Would it be possible to add a toggle to the search filter in the courses directory to allow users to filter and view only public groups and sites?
Do we want to think about the placement/function of this "view public courses" toggle along site the possible addition of an OER metadata tag and toggle?
#2 Updated by Sonja Leix 5 months ago
Boone Gorges wrote:
Adding Sonja to get her brief thoughts.
Sorry for the late response to this. I took a look and since this is a toggle vs. the various drop down menus we have in our filter UI, I'd recommend to add a simple check box below the line of filters to toggle this feature on/off. It could read something like "Show public courses only"
#4 Updated by Sonja Leix 5 months ago
Laurie Hurson wrote:
Thanks for your insight Sonja. This sounds like a good plan to me.
Would the check box be located in the gray filter box or below where the number of sites are listed? I think within the gray filter box might be more obvious.
Yes agreed, they should be part of the grey filter box. I suggest in the line below the other filters.
#5 Updated by Boone Gorges 5 months ago
- File Screenshot_2021-05-25_15-58-05.png Screenshot_2021-05-25_15-58-05.png added
- File Screenshot_2021-05-25_15-51-52.png Screenshot_2021-05-25_15-51-52.png added
- Target version set to 1.19.0
Thanks all. Agreed that a simple checkbox is fine.
I mocked up putting it in a second line. IMO it becomes confusing - it seems like it's tied to the search box, and it's no longer clear that the 'Filter' and 'Reset' buttons apply to this input.
I tried a second version that involved moving the action buttons to the second row. It's not visually great but it retains the distinction between filters and action buttons.
It's also worth flagging here that my mockups in #14170 suggest making other changes to this filter interface (though perhaps not on the Courses directory) and we risk mucking up an interface that we worked hard to keep clean and easy to understand.
#6 Updated by Sonja Leix 5 months ago
Since the user has to click "filter" after they check the new "public sites" checkbox, it makes more sense to drop the action buttons below the filter options. We might want to add a 1px separator between the action buttons and the filter options so it's clear, see rough adjusted mockup attached.
#8 Updated by Boone Gorges 5 months ago
- Assignee set to Boone Gorges
- Target version set to 1.19.0
Thanks, Sonja. Breaking the action buttons into a separate line gives us more flexibility in general, since we'll have more screen real estate to deal with. I'll see what I can do about working up a prototype.
#10 Updated by Colin McDonald about 1 month ago
I just wanted to bump this. Boone, did you end up working on a prototype? Is there anything else we can pass your way to help putting that together? We discussed on Friday that this ticket could be good to include in our regular package of release items related to teaching and course improvements.
#12 Updated by Boone Gorges 15 days ago
- File Screenshot_2021-10-05_10-29-19.png Screenshot_2021-10-05_10-29-19.png added
- File cac-fill-blog-public-courses.php cac-fill-blog-public-courses.php added
- Status changed from New to Testing Required
I've built a first pass at this, and it's ready for testing on cdev. A screenshot is also attached.
Fairly substantial changes were required to make this work. Here's a rundown, for posterity:
- Group 'status' and site 'blog_public' are stored in separate tables, in a way that could not be joined as part of the course query. As such, I needed to write routines to mirror these 'public' flags to postmeta, where I could use WP's meta_query.
- Some of the mirroring routines require a switch_to_blog(), because users can change their blog_public value while on the subsite. This means registering and unregistering certain taxonomies and post types on the fly, so that course queries work (WP doesn't handle this well natively; see https://core.trac.wordpress.org/ticket/20541)
- Because of the subsite issue, I also needed to change the plugin to be 'Network: true' so that it would detect blog_public changes on subsites. A side benefit of this change is that it's now possible to fix #14437, which I've done as part of my work here.
- I've written a CLI script to fill in the 'public' postmeta for existing courses, attached here. I'll need to run this after the release.
#14 Updated by Colin McDonald 15 days ago
Thanks Boone, I checked it out on cdev and it worked well for me. One simple thing, sorry if it's come up before, but when I searched "english" the first result is "scott test group creation" and it has a public group and private site. After hitting the public courses only filter, that result is still there. Is that expected behavior, that we'd rather show the public group even if it has a private site? Makes sense to not hide both altogether?