Bug 25735 - Add distinct classes for clear history (.clearsh) links on OPAC
Summary: Add distinct classes for clear history (.clearsh) links on OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-12 19:58 UTC by Lucas Gass
Modified: 2021-12-13 21:09 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 25735: Add seperate classes for each clearsh button (2.91 KB, patch)
2020-06-12 20:10 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2020-06-12 19:58:53 UTC
As of 19.11 the OPAC navbar has a nice dropdown for logged in users that includes search history and a clearsh link which clears you history. 

clearsh also exists on the navbar for unauthenticated users. These two clearsh buttons have a very similar HTML structure and it makes it almost impossible to style the two links independently.

Some libraries will want to style the background and text colors of each of these clearsh links independent of one another.

It would be easy to give each one its own class to make this easy.
Comment 1 Lucas Gass 2020-06-12 20:10:24 UTC
Created attachment 105850 [details] [review]
Bug 25735: Add seperate classes for each clearsh button

TEST PLAN:
1. Apply patch
2. Add these two lines to the OPACUserCSS:
    .clearsh-one {color:green !important;}
    .clearsh-two {color:red !important;}
3. Refresh OPAC and be logged out, the "Clear" button in the top right should now be green.
4. Refresh OPAC and be logged in, the "Clear" button inside the dropdown on the top right should be red.
Comment 2 Owen Leonard 2021-02-26 15:50:54 UTC
I hadn't notice this patch before because it was still marked "NEW." I think things may have changed a little since this was originally submitted. There is a fairly simple way to differentiate the two links now:

/* Color for logged-out users */
.clearsh {color:green !important;}

/* Color for logged-in users */
#loggedinuser-menu .clearsh { color:blue !important}

I prefer this to adding the -one -two classes because they're not semantically meaningful.