openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Unify `admin_bar.html` and the revert feature of `viewpage.html`

Open scottbarnes opened this issue 1 year ago • 6 comments

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:

  1. rename admin_bar.html and the admin-bar CSS class to something like advanced_options.html and advanced-options in CSS; and
  2. 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': image

Here's how the admin bar looks, while also viewing a page which can be reverted: image

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

scottbarnes avatar Mar 16 '24 02:03 scottbarnes

May I solve this issue?

devesh-2002 avatar Mar 16 '24 05:03 devesh-2002

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.

scottbarnes avatar Mar 16 '24 13:03 scottbarnes

I could work on this feature, if @devesh-2002 is no longer interested.

Noronha01 avatar Apr 23 '24 11:04 Noronha01

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.

jimchamp avatar Apr 26 '24 00:04 jimchamp

can I start working on it?

Abhaysoft-inc avatar Jun 16 '24 15:06 Abhaysoft-inc

For me you can, I am no longer working on it.

Noronha01 avatar Jun 16 '24 20:06 Noronha01

Hi @mekarpeles, could you please assign this issue to me? It would mean a lot to me as my first step into open source.

mohitpaddhariya avatar Jan 21 '25 15:01 mohitpaddhariya

@dev-mohit06 Before making code changes, can you help us with breakdown by:

  1. Clarifying what you believe the task to be
  2. Identifying which files are related to the issue
  3. Asking any questions you may have about the goal or requirements of this issue
  4. Proposing a solution or approach

jimchamp avatar Jan 22 '25 16:01 jimchamp

hi @jimchamp, if this issue is still open can i contribute to it? i can submit the pre-requisites if you like

krishnaGauss avatar Mar 12 '25 19:03 krishnaGauss

Yes! Happy to assign you, @krishnaGauss, if you can address each of the points outlined here.

jimchamp avatar Mar 12 '25 23:03 jimchamp

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:

  1. 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.
  2. 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
  1. 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
  1. 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.

krishnaGauss avatar Mar 21 '25 12:03 krishnaGauss