Bugzilla – Attachment 27784 Details for
Bug 12162
Add class="branchcode" to body tag to make OPAC CSS-styleable per branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Proof of concept] Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch
Proof-of-concept-Bug-12162---Add-classbranchcode-t.patch (text/plain), 3.42 KB, created by
Marc Véron
on 2014-04-29 20:43:07 UTC
(
hide
)
Description:
[Proof of concept] Bug 12162 - Add class="branchcode" to body tag to make OPAC CSS-styleable per branch
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2014-04-29 20:43:07 UTC
Size:
3.42 KB
patch
obsolete
>From 091c08deea9a8692a30c78be5b0bd7f2c764b3ca Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Wed, 23 Apr 2014 16:32:20 +0200 >Subject: [PATCH] [Proof of concept] Bug 12162 - Add class="branchcode" to > body tag to make OPAC CSS-styleable per branch > >This patch implements branch specific CSS for Opac Main page and OPAC Search. If the proof of concept works out, other Opac pages can be adapted. > >To test: >Apply patch >Edit system preference OPACUserCSS and insert something like > >/*Background for all branches*/ >body { >background-color: red; >} > >/*Yellow background and pink border for branch with code CPL*/ >body.CPL { >background-color: yellow; >border: 10px solid pink; >} > >/*Green background and red border for branch with code FFL*/ >body.FFL { >background-color: green; >border: 10px solid red; >} > >Go to Opac. Switch between branches CPL and FFL, see how background color changes... >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 2 +- > opac/opac-main.pl | 4 ++++ > opac/opac-search.pl | 5 +++++ > 4 files changed, 12 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index c55eccc..f8b0ca6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -5,7 +5,7 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > </head> >-<body id="advsearch" class="scrollto"> >+<body id="advsearch" class="scrollto[% IF ( homebranch ) %] [%homebranch%] [% END %]"> > [% INCLUDE 'masthead.inc' %] > <form action="/cgi-bin/koha/opac-search.pl" method="get"> > <div class="main"> >@@ -392,4 +392,4 @@ > }); > //]]> > </script> >-[% END %] >\ No newline at end of file >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 5b68c19..028ad6c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -4,7 +4,7 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > </head> >-<body id="opac-main"> >+<body id="opac-main" [% IF ( homebranch ) %] class="[%homebranch%]" [% END %]> > [% INCLUDE 'masthead.inc' %] > > <div class="main"> >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index a58659c..b5adff6 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -39,6 +39,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >+if (C4::Context->userenv) { >+ $template->param(homebranch => C4::Context->userenv->{'branch'},); >+} >+ > my $casAuthentication = C4::Context->preference('casAuthentication'); > $template->param( > casAuthentication => $casAuthentication, >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index e2236c2..d16a6e0 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -120,6 +120,11 @@ else { > authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), > } > ); >+ >+if (C4::Context->userenv) { >+ $template->param(homebranch => C4::Context->userenv->{'branch'},); >+} >+ > if ($template_name eq 'opac-results.tmpl') { > $template->param('COinSinOPACResults' => C4::Context->preference('COinSinOPACResults')); > } >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12162
:
27784
|
27811
|
30319
|
30536
|
30537
|
30606
|
30607
|
30770
|
31803
|
31807