Bug 9558 - Customize CSS for mobile
Summary: Customize CSS for mobile
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 16:13 UTC by Zachary Spalding
Modified: 2015-06-04 23:23 UTC (History)
3 users (show)

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


Attachments
Bug 9558 - Customize CSS for mobile (2.90 KB, patch)
2013-05-17 18:35 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9558 - Customize CSS for mobile (2.26 KB, patch)
2013-06-04 06:09 UTC, Srdjan Jankovic
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Zachary Spalding 2013-02-06 16:13:04 UTC
Would like to have the ability to override the mobile.css like we can with opac.css.  

Mabye something like SetEnv OPAC_CSS_OVERRIDE_MOBILE <CSS file>
Comment 1 Owen Leonard 2013-05-17 17:00:04 UTC
Isn't this what the OPACMobileUserCSS system preference is for?
Comment 2 Zachary Spalding 2013-05-17 17:41:39 UTC
The problem with OPACMobileUserCSS from my understanding is a global change.  In my case I have 15 organizations that are sharing one Koha instance but each want there own look.  

We the opac.css override I am able to do that for the average computer use and but now need a way to do this for mobile as well.

I did come up with my own modifications to solve this problem but do not know enough on how to submit it for inclusion into the Koha code.

Changed Auth.pm
Around line 412 to add support for multiple css for mobile devices
opac_css_override_mobile    => $ENV{'OPAC_CSS_OVERRIDE_MOBILE'},

Changed doc-head-close.inc
Around line28
[% IF ( opac_css_override_mobile ) %]
                <link rel="stylesheet" type="text/css" media="screen and (max-width:700px)" href="[% themelang %]/css/[% opac_css_override_mobile %]" />
[% END %]


These are my productions examples
http://vassar.koha.senylrc.org
http://hhs.koha.senylrc.org
http://nki.koha.senylrc.org/
Comment 3 Owen Leonard 2013-05-17 18:35:35 UTC Comment hidden (obsolete)
Comment 4 Srdjan Jankovic 2013-06-04 06:09:18 UTC
Created attachment 18637 [details] [review]
[SIGNED-OFF] Bug 9558 - Customize CSS for mobile

It is possible to use an environment variable to specify a custom
stylesheet for different libraries in a multi-library system:
$ENV{'OPAC_CSS_OVERRIDE'}. This patch adds an additional option to
override the CCSR theme's mobile stylesheet.

The changes in this patch are courtesy Zachary Spalding as described in
Bug 9558. Patch and test plan created by Owen Leonard.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Comment 5 Kyle M Hall 2013-06-14 16:52:58 UTC
I really like this, but I think there is a small issue.

It seems to me that the opac_css_override_mobile link should be after the opac_css_override link so it has precedence. 

The other alternative would be to have opac_css_override only be triggered for screen width of greater than 700px, such that the two are mutually exclusive.

If my concerns are invalid please reset the status to "Signed Off"
Comment 6 Owen Leonard 2014-07-01 17:17:24 UTC
CCSR is now deprecated.