Feature #14457
closedToggle for Public Sites in Course Directory
Added by Laurie Hurson over 3 years ago. Updated over 2 years ago.
0%
Description
HI All,
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?
Files
Related issues
Updated by Boone Gorges over 3 years ago
Adding Sonja to get her brief thoughts.
Updated by Sonja Leix about 3 years 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"
Updated by Laurie Hurson about 3 years ago
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.
Updated by Sonja Leix about 3 years 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.
Updated by Boone Gorges about 3 years 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.
Updated by Sonja Leix about 3 years ago
Thanks Boone,
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.
Updated by Laurie Hurson about 3 years ago
- Target version deleted (
1.19.0)
Looks good to me, I like the 1px line separation.
Updated by Boone Gorges about 3 years 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.
Updated by Colin McDonald almost 3 years 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.
Updated by Boone Gorges almost 3 years ago
No, I haven't worked anything up, but I'll try to take a look in the next week or so.
Updated by Boone Gorges almost 3 years 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.
Updated by Boone Gorges almost 3 years ago
- Related to Bug #14437: Deleted Sites Show Up On Courses Tab added
Updated by Colin McDonald almost 3 years 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?
Updated by Boone Gorges almost 3 years ago
I've interpreted 'public' as "has either a public site or a public group". This can be changed if there's consensus that it should mean "has no private site or private group".
Updated by Colin McDonald almost 3 years ago
That interpretation tracks for me too. Adding a couple other watchers here in case they want to weigh in.
Updated by Matt Gold almost 3 years ago
As someone who teaches with a public site and private group, that makes sense to me
Updated by Laurie Hurson almost 3 years ago
Yes, this make sense to me too. If either the group or site is public, the course should be visible when "view public courses" is checked.
Updated by Laurie Hurson over 2 years ago
This appears to work as intended on cdev.
With toggle clicked, courses display in directory if either group or site is public.
Updated by Colin McDonald over 2 years ago
- File site-still-shows.png site-still-shows.png added
I tried changing privacy settings for a group and a group+site, and this worked as intended. If changed to private, the result disappeared when Public Only was checked. But for this site:
https://teachtest.commons.gc.cuny.edu/
When I changed, it seemed to go private but not disappear from the results when the box is checked. See screenshot.
Updated by Boone Gorges over 2 years ago
Thanks, Colin. This is a bug related to the fact that you were changing the visibility on the site's Dashboard. The metadata saving routine wasn't configured to run on options-reading.php.
I fixed this, but then found that there was an odd problem with advanced-post-cache. The Course was still showing up even after the has-public-group-or-site postmeta was deleted. It could be that this is a core bug, or a bug in advanced-post-cache. I couldn't figure it out so I just excluded cac_course from advanced-post-cache altogether.
https://github.com/cuny-academic-commons/cac/commit/e147a636af712105ca643aafc8d6993cc7a9b2d5
https://github.com/cuny-academic-commons/cac/commit/8e7de897ea5a6f2829fc658ae512a15959d4ec3a
https://github.com/cuny-academic-commons/cac/commit/5249f04762f48de269a9310d39825c69a3aad985
Updated by Colin McDonald over 2 years ago
- File 1-screenshot.png 1-screenshot.png added
- File 2-screenshot.png 2-screenshot.png added
- File 3-screenshot.png 3-screenshot.png added
Hi Boone, I just set up a new public site that was NOT a teaching site, just a simple public site, "colin site to delete" at this URL added to hosts file:
https://todelete.commons.gc.cuny.edu
Then I went in and changed it to Teaching and it showed up in the Courses directory as in 1-screenshot attached. Then I changed it to private, and it still appeared with Show Public checked at the top of Newly Created, except with no links or other data as in 2-screenshot attached. Then I toggled back and see two different results, as in 3-screenshot attached.
Updated by Boone Gorges over 2 years ago
Colin - Somehow, your test site got associated with more than one Course object in the database. Once I deleted the duplicates, the problem no longer occurs.
I don't see how the duplicates occurred in the first place. If you manage to reproduce it, please take very careful note of the specific things you're doing, and share these notes with me. For example, it's critically important that I know exactly where you're going to toggle privacy changes, and what you're changing them from/to.
Updated by Colin McDonald over 2 years ago
- File 1-courses.png 1-courses.png added
- File 2-courses.png 2-courses.png added
Hi Boone, I was able to reproduce it this way, as detailed as I think I can describe:
- Created fresh new public site "delete later colin" via creation portal, campus Brooklyn and purpose Conference.
- In Settings > General, changed Purpose to Teaching, Term to Spring 2022, cluster to STEM. OER box is unchecked.
- The site now showed up in Courses as in attached 1-courses screenshot. Not sure if it should have had instructor or other lines within the item box.
- In Settings > Reading for the site, changed Site Visibility from Allow search engines... to I would like... users I add to it. Then refresh Courses, sorted by Newly Added, and two items appear as in 2-courses screenshot attached.
Left it like that for now in case you wanted to examine. Didn't want to try toggling back or complicating the sequence more.
Updated by Boone Gorges over 2 years ago
This issue is caused by what's described https://redmine.gc.cuny.edu/issues/14897#note-16 and should be fixed by the same changes.
Updated by Boone Gorges over 2 years ago
- Status changed from Testing Required to Resolved
I've run the migration script, and public courses are now showing up in the Courses directory: https://commons.gc.cuny.edu/courses/?filters%5Bkeyword%5D=&filters%5Bpublic%5D=on&order-by=semester