From 6246f2c70049baf86bc942c2473793c83057a64f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Fri, 25 Jul 2014 23:57:54 +0200 Subject: [PATCH] Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch This patch adds a branch sepecific class to all OPAC pages. Example: If not logged in, opac-main.pl displays: If logged in at branch FFL, it displays: If you log in, opac-user.pl should display To test: 1) Apply patch. 2) Add to syspref OPACUserCSS something highly visible, e.g. for branch FFL: .branch-FFL { background-color: yellow; border: 10px solid red; } 3) Go to OPAC and login in with a user with home branch FFL 4) Verify that colors change as appropriate. 5) Log out. Verify that colors display as before or as defined in class branch-default in OPACUserCSS 6) Display patch in patch diff view, verify that ids and classes in body tag are consistent with params bodyid and bodyclass in INCLUDE line 7) Search for regressions Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../opac-tmpl/bootstrap/en/includes/bodytag.inc | 15 +++++++++++++++ .../bootstrap/en/modules/opac-ISBDdetail.tt | 4 ++-- .../bootstrap/en/modules/opac-MARCdetail.tt | 2 +- .../bootstrap/en/modules/opac-account.tt | 1 + .../en/modules/opac-addbybiblionumber.tt | 4 ++-- .../bootstrap/en/modules/opac-advsearch.tt | 2 +- .../bootstrap/en/modules/opac-alert-subscribe.tt | 4 ++-- .../bootstrap/en/modules/opac-auth-MARCdetail.tt | 4 ++-- .../bootstrap/en/modules/opac-auth-detail.tt | 4 ++-- .../opac-tmpl/bootstrap/en/modules/opac-auth.tt | 2 +- .../bootstrap/en/modules/opac-authorities-home.tt | 4 ++-- .../modules/opac-authoritiessearchresultlist.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 2 +- .../bootstrap/en/modules/opac-blocked.tt | 2 +- .../bootstrap/en/modules/opac-browser.tt | 4 ++-- .../bootstrap/en/modules/opac-course-details.tt | 4 ++-- .../bootstrap/en/modules/opac-course-reserves.tt | 4 ++-- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- .../bootstrap/en/modules/opac-downloadcart.tt | 2 +- .../bootstrap/en/modules/opac-downloadshelf.tt | 4 ++-- .../en/modules/opac-full-serial-issues.tt | 4 ++-- .../bootstrap/en/modules/opac-imageviewer.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-main.tt | 2 +- .../modules/opac-memberentry-update-submitted.tt | 2 +- .../bootstrap/en/modules/opac-memberentry.tt | 2 +- .../bootstrap/en/modules/opac-messaging.tt | 2 +- .../bootstrap/en/modules/opac-overdrive-search.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-passwd.tt | 2 +- .../bootstrap/en/modules/opac-privacy.tt | 2 +- .../bootstrap/en/modules/opac-readingrecord.tt | 2 +- .../en/modules/opac-registration-confirmation.tt | 4 ++-- .../en/modules/opac-registration-email-sent.tt | 4 ++-- .../en/modules/opac-registration-invalid.tt | 4 ++-- .../bootstrap/en/modules/opac-reserve.tt | 2 +- .../bootstrap/en/modules/opac-results-grouped.tt | 2 +- .../bootstrap/en/modules/opac-results.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-review.tt | 2 +- .../bootstrap/en/modules/opac-search-history.tt | 2 +- .../bootstrap/en/modules/opac-sendbasketform.tt | 2 +- .../bootstrap/en/modules/opac-sendshelfform.tt | 2 +- .../bootstrap/en/modules/opac-serial-issues.tt | 2 +- .../bootstrap/en/modules/opac-shareshelf.tt | 2 +- .../bootstrap/en/modules/opac-shelves.tt | 2 +- .../bootstrap/en/modules/opac-showmarc.tt | 2 +- .../bootstrap/en/modules/opac-showreviews.tt | 4 ++-- .../bootstrap/en/modules/opac-suggestions.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-tags.tt | 2 +- .../bootstrap/en/modules/opac-tags_subject.tt | 2 +- .../bootstrap/en/modules/opac-topissues.tt | 4 ++-- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- 50 files changed, 80 insertions(+), 64 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc new file mode 100644 index 0000000000..487d7e94f4 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/bodytag.inc @@ -0,0 +1,15 @@ +[% classprop = 'class="' %] +[% IF LoginBranchcode.defined %] + [% classprop = classprop _ 'branch-' _ LoginBranchcode %] +[% ELSE %] + [% classprop = classprop _ 'branch-default' %] +[% END %] +[% IF bodyclass.defined %] + [% classprop = classprop _ ' ' _ bodyclass %] +[% END %] +[% classprop = classprop _ '"' %] + +[% IF bodyid.defined %] + [% idprop = 'ID="' _ bodyid _ '" ' %] +[% END %] + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-ISBDdetail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-ISBDdetail.tt index a62b4f122f..5fd52cd823 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-ISBDdetail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-ISBDdetail.tt @@ -3,7 +3,7 @@ [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] - +[% INCLUDE 'bodytag.inc' bodyid='opac-isbddetail' bodyclass='scrollto' %] [% INCLUDE 'masthead.inc' %]
[% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %][% END %] \ No newline at end of file +[% BLOCK jsinclude %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt index 3ad12cf91b..eb9e0e1a73 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt @@ -3,7 +3,7 @@ [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] - +[% INCLUDE 'bodytag.inc' bodyid='opac-marcdetail' bodyclass='scrollto' %] [% INCLUDE 'masthead.inc' %]