Unify `admin_bar.html` and the revert feature of `viewpage.html`
NOTE: "revert" is currently being called by Infogami, so that may require special consideration, and make it poorly suited to being a good first or second issue.
Describe the problem that you'd like solved
We have an "admin bar" with some options in it, then a separate html file with separate styling for the revert button, when we may want to have them together.
Proposal & Constraints
During today's design call we briefly mentioned extending admin_bar.html (and the associated styling for admin-bar) by adding the revert button to it.
To this end we'd want to:
- rename
admin_bar.htmland theadmin-barCSS class to something likeadvanced_options.htmlandadvanced-optionsin CSS; and - ensure proper permissions/scoping for the buttons in this unified view.
Here's how the "revert" button looks on Author, pages, List pages, and probably anywhere else, aside from Work and Edition pages, which u sed to look this way, but at some point 'broke':
Here's how the admin bar looks, while also viewing a page which can be reverted:
Based on the call today, we'd want to the revert button inside the admin bar, to the right of View Book on Archive.org (which we may also want to remove, but that may be a separate discussion).
Additional context
The complicating factor here is that viewpage.html seems to be called by Infogami, so we'd want to be extra sure nothing is breaking from changes to viewpage.html, because it's Infogami that is making viewpage.html automagically render where it can be used.
Stakeholders
May I solve this issue?
I think for this issue it will be a good idea to wait until after it has been triaged on Monday, as perhaps we'll want a different approach, and I wouldn't want you or anyone else potentially spending time on work that isn't needed.
I could work on this feature, if @devesh-2002 is no longer interested.
Thanks, @Noronha01! You've been assigned.
As @scottbarnes mentioned, this may actually not be a good issue for new contributors. Give it a try and let me know if you have any questions. If it's too difficult, I can relabel this issue and help you find something more appropriate to work on.
can I start working on it?
For me you can, I am no longer working on it.
Hi @mekarpeles, could you please assign this issue to me? It would mean a lot to me as my first step into open source.
@dev-mohit06 Before making code changes, can you help us with breakdown by:
- Clarifying what you believe the task to be
- Identifying which files are related to the issue
- Asking any questions you may have about the goal or requirements of this issue
- Proposing a solution or approach
hi @jimchamp, if this issue is still open can i contribute to it? i can submit the pre-requisites if you like
Yes! Happy to assign you, @krishnaGauss, if you can address each of the points outlined here.
Yes! Happy to assign you, @krishnaGauss, if you can address each of the points outlined here.
Sorry @jimchamp , my laptop broke down the day after this message, but here are the prerequisites, to the best of my knowledge:
- According to me, the task is to simply integrate revert-button from viewpage.html to admin_bar.html for maintaining consistency in UI/UX and styling. Also to avoid breaking any current infogami-interactions.
- Files related to this are:
- openlibrary\templates\type\edition\admin_bar.html -> contains admin-related stuff
- openlibrary\templates\viewpage.html -> contains "Revert" button functionality
- static\css\components\work.less -> contains styling for admin_bar.html
- static\css\legacy.less -> contains "Revert button" styling
- I have a few questions to ask:
- Does the revert functionality depend on any backend logic that could break if moved?
- Why can't i see the revert functionality although am running the setup correct? Link
- Proposed solution is fairly simple:
- Move Revert Button to admin_bar.html – Shift the revert functionality from viewpage.html to admin_bar.html to centralize admin actions. Also renaming the new codes as described above.
- Test Across Pages – Check all routes where the revert button was originally present, ensuring it appears correctly and works without errors.