Bug 8263 - Make OPAC stylesheet preferences more consistent
Summary: Make OPAC stylesheet preferences more consistent
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-18 08:39 UTC by Marcel de Rooy
Modified: 2014-05-26 21:05 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Patch for 8263 (13.82 KB, patch)
2012-06-18 12:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Database revision for 8263 (1.62 KB, patch)
2012-06-18 12:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Rebased patch for 8263 (13.15 KB, patch)
2012-06-20 12:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Rebased dbrev for 8263 (1.67 KB, patch)
2012-06-21 06:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Rebased dbrev (1.69 KB, patch)
2012-07-04 14:12 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Patch for 8263 (13.21 KB, patch)
2012-07-18 11:26 UTC, Marcel de Rooy
Details | Diff | Splinter Review
8263 Make OPAC stylesheet preferences more consistent (dbrev) (1.71 KB, patch)
2012-07-20 10:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
8263 Consistent stylesheet prefs (13.23 KB, patch)
2012-07-20 10:21 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2012-06-18 08:39:36 UTC
opaccolorstylesheet should support remotes, but does not work.
opaclayoutstylesheet and opacstylesheet could just be one pref (just as opaccolorstylesheet already advertises)
Comment 1 Marcel de Rooy 2012-06-18 12:36:11 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2012-06-18 12:38:18 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2012-06-18 12:48:14 UTC
Test the second (dbrev) patch with:
Before applying the patch, put a remote URL in pref opacstylesheet. Apply the patch and run the dbrev (cgi-bin/koha/installer/install.pl?step=3).
Check if opaclayoutstylesheet now contains your URL.

Test the first (functionality) patch with:
1) Blank opaccolorstylesheet.
2) Put colors.css into opaccolorstylesheet. (By default, this file is empty. But note that it should list now in the opac html page source. Right-click in your browser and find that option in the menu.)
3) Put a full URL (could be your own webserver) starting with http:// into opaccolorstylesheet. Check opac again.
4) Blank opaclayoutstylesheet. Do you have default styles in opac?
5) Put opac.css into opaclayoutstylesheet. No difference? That is expected.
6) Put a full URL into opaclayoutstylesheet. If you have a different stylesheet, put that in with the full http:// prefix. Check your opac.
Comment 4 Marcel de Rooy 2012-06-20 12:11:37 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2012-06-21 06:49:56 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2012-07-04 14:12:36 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2012-07-17 19:36:43 UTC
[% IF (opaclayoutstylesheet.match('^http:|^\/')) %]

Should we allow for the possibility of a stylesheet served by https:// ?
Comment 8 Marcel de Rooy 2012-07-18 11:13:59 UTC
(In reply to comment #7)
> Should we allow for the possibility of a stylesheet served by https:// ?

Sure, good point. Will send new version. Thx.
Comment 9 Marcel de Rooy 2012-07-18 11:26:10 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2012-07-20 10:21:00 UTC
Created attachment 11035 [details] [review]
8263 Make OPAC stylesheet preferences more consistent (dbrev)

This patch handles the dbrev for this report. It optionally saves the value of the former opacstylesheet pref into opaclayoutstylesheet.

June 21, 2012 & July 4, 2012: Rebased.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 11 Jonathan Druart 2012-07-20 10:21:33 UTC
Created attachment 11036 [details] [review]
8263 Consistent stylesheet prefs

This patch makes the use of opaccolorstylesheet and opaclayoutstylesheet more consistent. They may be: 1) just a file name, 2) a complete local path or 3) a full URL starting with http: for a remote css file.
This makes the syspref opacstylesheet that was only used for a remote css file obsolete.

June 20, 2012 Rebased.
July 18, 2012: Regex allows https too (thanks to Owen Leonard).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 12 Jonathan Druart 2012-07-20 10:23:27 UTC
Works well

It would be great to have the same behaviour for the Intranet systempreference.

+ Maybe a followup is required to update the description of syspref (support for http AND https) ?
Comment 13 Marcel de Rooy 2012-07-20 13:57:00 UTC
(In reply to comment #12)
> It would be great to have the same behaviour for the Intranet
> systempreference.
> 
> + Maybe a followup is required to update the description of syspref (support
> for http AND https) ?

Thanks for signing off on this one. We could start a new report for the Intranet side. Will later send a followup for textual change; I hesitated with adjusting the text because there are much more cases in the pref descriptions where http or https could or should be written. But I already wanted Koha to work with it.
Comment 14 Paul Poulain 2012-08-03 10:06:37 UTC
QA comment:
 * FAUSP leader is happy ;-)
 * clean code that should gracefully handle existing setups
 * passes koha-qa.pl -c 2
 * grepped opacstylesheet, and I can't see references to this string outside from updatedatabase and translations (it will be removed automatically later, when translation process start)

passed QA
Comment 15 Marcel de Rooy 2013-04-15 10:46:30 UTC
This report now has its staff client counterpart: bug 10052.