Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customized menu for the admin course. #2009

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

somiaj
Copy link
Contributor

@somiaj somiaj commented May 30, 2023

Move the links (nav menu) from the top of the admin page over to
the main menu. Also remove most of the course links since they
don't really do much on the admin page. Label this new menu
'Admin Menu'.

The only old menu items used are the user settings to be able to change the password, class list editor, and email since the admin users may want to email various instructors or manage them (since they are created automatically with new courses). There was also some discussion of maybe the file manager being useful, but not added here. I had wondered if the admin file manager could go up one more directory to the courses directory root, so admin users have access to all course files.

@Alex-Jordan
Copy link
Contributor

I poked around and it looks good. i did not try actually using admin tools but i assume they still all work.

Should there still be a Help menu item? (Specialized to the admin course...) And report bugs?

@somiaj
Copy link
Contributor Author

somiaj commented May 30, 2023

I think if we want help menu items, we should also give more help to the various admin pages, similar to what has been done for normal courses. That is beyond this pull request though, maybe another pull request can add admin help pages and a general help menu.

I can add the report bugs link, though for course admins, is that Bugzilla link the appropriate place to send them to report bugs about the admin course? Though I guess they could also be reporting bugs about a problem or something else as well, just using the admin course for the link.

@pstaabp
Copy link
Member

pstaabp commented May 30, 2023

Overall, this looks good and I agree with having some help pages as well.

I wonder if the User Settings is needed, since you've included the classlist editor and the password/email can be changed there and the other settings are relevant.

@Alex-Jordan
Copy link
Contributor

I wonder if the User Settings is needed, since you've included the classlist editor and the password/email can be changed there and the other settings are relevant.

I don't think you can change your own password there anymore.

@drgrice1
Copy link
Member

I think the "Course Administration link should be above the "User Settings" link in the nav. That is the home page, and so it should be first.

Probably the coloring should either be dispensed with for the admin course, or made entirely the way the #2010 makes it for students. In other words, uniform.

@somiaj somiaj force-pushed the admin-course-menu branch 2 times, most recently from 948231b to 3b6ac93 Compare May 31, 2023 03:45
@somiaj
Copy link
Contributor Author

somiaj commented May 31, 2023

Moved user settings more towards the bottom (under the course admin links right before the class list editor). Added report bug link. Made everything the primary color assuming #2010 gets accepted. The Menu header's color will be updated with #2010 changes.

I think the admin help additions should be put in another pull request, so leaving help link off for now.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I think this is a nice improvement to the admin course.

Eventually it would be good to remove the sub_display url paramenter, and make the admin pages proper routes. But that is for future work.

templates/ContentGenerator/Base/admin_links.html.ep Outdated Show resolved Hide resolved
templates/ContentGenerator/Base/admin_links.html.ep Outdated Show resolved Hide resolved
  Move the links (nav menu) from the top of the admin page over to
  the main menu.  Also remove most of the course links since they
  don't really do much on the admin page.  Label this new menu
  'Admin Menu'.
@somiaj somiaj force-pushed the admin-course-menu branch from 3b6ac93 to 1665841 Compare May 31, 2023 14:05
@somiaj
Copy link
Contributor Author

somiaj commented May 31, 2023

Applied @drgrice1 code cleanup comments. I am working on adding some help items to the admin pages (in case someone else was thinking about working on this). I'll add a PR when its ready, though lots of the help is quite short (most pages already describe what they do). We can talk about this more once I make the PR.

@somiaj somiaj mentioned this pull request Jun 1, 2023
@Alex-Jordan
Copy link
Contributor

I'm interested in keeping File Manager available in the admin course.

After Googling today, I find that I can:

cd /opt/webwork/courses/admin
sudo mkdir courses
sudo chown apache:apache courses
sudo mount --bind /opt/webwork/courses courses
sudo mount -o bind,remount,ro courses

And now in the admin course's file manager, I have a courses folder that is like a symlink to /opt/webwork/courses/ except that everything I access through this courses mount is read-only.

This would be useful for me managing the Runestone server, where users request their full archive files from the past, and I could get them through the admin course. And I'm not risking some kind of accident since it's read-only.

Similarly, I might want to mount like this to the webwork2/logs/ folder.

Thoughts on this?

@somiaj
Copy link
Contributor Author

somiaj commented Jun 1, 2023

@Alex-Jordan My thoughts was to just give the admin file manager access to all courses by allowing it to move all the way up to the courses root directory. This also makes it so the admin file manager can download and upload archives (which cannot currently be done). It appears this is fairly easy to pull off, I have a patch on this branch, https://github.com/somiaj/webwork2/tree/admin-file-manager. Thoughts?

@Alex-Jordan
Copy link
Contributor

Personally I would like to avoid the admin course having so much write access. With what you propose, one of my colleagues (who have access to the admin course) might accidentally do something very bad and lose/corrupt files from the courses folder tree.

@somiaj
Copy link
Contributor Author

somiaj commented Jun 1, 2023

Ahh I missed you mounted the link read only. I still think it would be nice to be able to add archives (I like to copy an archive from my live server to my test server) from the admin course, though since I have server access it isn't needed. Though agreed it might be too much access. In either case I can add the file manager back.

@pstaabp
Copy link
Member

pstaabp commented Jun 1, 2023

I think this comment got lost above (or lost in translation). On the User Settings, there are the "Change Display Settings", which isn't relevant for the admin course. It looks like you are using the existing User Settings page. Can the "Change Display Settings" block be hidden if the course is the admin course?

@pstaabp pstaabp merged commit af599e9 into openwebwork:WeBWorK-2.18 Jun 1, 2023
@Alex-Jordan
Copy link
Contributor

I know this is merged now but this seems like an OK place for discussion. How do you feel about:

  1. "Course Administration" -> "Course Listings" ? It's no longer the page for doing all the administration.
  2. Swap the order of "Manage Locations" and "Hide Courses".
  3. Make all the singular "Course" into a uniform plural "Courses", or drop the trailing "Course"/"Courses" altogether from the nav links.
  4. Remove the "Courses" link. It's not really offering anything that "Course Administration"/"Course Listing" isn't offering already.

(Actually maybe "Courses" can go away for all courses? You can just click the WeBWorK logo to get there if you want to...)

@somiaj
Copy link
Contributor Author

somiaj commented Jun 2, 2023

Seems reasonable, maybe add a PR.

3. Make all the singular "Course" into a uniform plural "Courses", or drop the trailing "Course"/"Courses" altogether from the nav links.

The plural is being used to indicate wither the tool can only act on a single course at a time or multiple courses at a time.

@somiaj somiaj deleted the admin-course-menu branch June 2, 2023 06:10
@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

@Alex-Jordan: All of your suggestions sound good. Could you work up a PR for those things? Note that if you remove the "Courses" link from the site nav, then you will also need to find a fix for @somiaj's issue pointed out in #2010 (comment).

@Alex-Jordan
Copy link
Contributor

Alex-Jordan commented Jun 2, 2023 via email

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

If a user below admin level enters the admin course, is it the case that all they see is user settings? I haven't checked.

That is a good question. That certainly should be the case. I will check that when I get a chance.

@somiaj
Copy link
Contributor Author

somiaj commented Jun 2, 2023

I don't think I tested for this, so most likely all users in the admin course see the same menu.

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

I just tested this, and yes, all users see the full site nav. Users that don't have student permissions see "You are not authorized to create or delete courses" or "You are not authorized to access instructor tools" for all of the pages except the "User Settings" page. Users that only have "professor" permission can actually create and delete courses (and do everything). So this is a problem that needs to be fixed.

@somiaj
Copy link
Contributor Author

somiaj commented Jun 2, 2023

  1. Make all the singular "Course" into a uniform plural "Courses", or drop the trailing "Course"/"Courses" altogether from the nav links.

The plural is being used to indicate wither the tool can only act on a single course at a time or multiple courses at a time.

Note, it appears that Archive Course should then be Archive Courses, because you can select multiple courses at once to archive (though then you end up archiving them one at a time with a string of confirmation pages). I'm not suggesting you keep this naming convention, just pointing out what I thought the plural was being used for. It will probably look better to be more consistent in the menu.

@Alex-Jordan If you make a PR to update the link names here, might also want to consider some of the suggestions in #1992 and update the names on the main menu as well.

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

@somiaj: Making the renames from #1992 is a little more involved than just changing the links in the site nav. Then you also need to change all of the references to those things in the help files.

@Alex-Jordan
Copy link
Contributor

I am about to open a PR that has my initial suggestions. I have to stop WW stuff for the rest of the day and possibly weekend. So the things from #1992 and the issue about people with low permissions being able to do things they shouldn't will come separately. I don't think I will bee available until late next week, so if anyone else wants to do those, go for it.

@somiaj
Copy link
Contributor Author

somiaj commented Jun 2, 2023

I will go fix the issue I overlooked with permissions.

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

I just tested on webwork 2.17, and I see that a user with 'student' permissions in the admin course can't see or do anything. However, a user with 'professor' permissions could create and delete courses (and everything else). So this change makes the 'student' user issue messy looking, but the 'professor' issue is not new (but should be fixed).

@somiaj
Copy link
Contributor Author

somiaj commented Jun 2, 2023

Removing the items from the menus will be easy for 'professor' or anyone with 'access_instructor_tools', but if they actually type in the URL of a given instructor tool they will most likely still have access. Maybe just increase 'access_instructor_tools' to 'admin' in the admin course.conf file? This may not work for existing admin courses though.

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

Looking into this a bit more, I think that you don't need to worry about the 'professor' user being able to create and delete courses and such. The issue with that is not in any of the admin course code. Permissions are actually checked there. The problem is in defaults.conf. The permission level for the "create_and_delete_courses" action is "professor". That is why this is happening.

@drgrice1
Copy link
Member

drgrice1 commented Jun 2, 2023

So all that needs to be done is to hide the links for those that do not have permission to perform those actions.

@somiaj somiaj mentioned this pull request Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants