Bugzilla – Attachment 56109 Details for
Bug 14764
Add OPAC News branch selector
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14764: OPAC news selector - Template tags
Bug-14764-OPAC-news-selector---Template-tags.patch (text/plain), 4.26 KB, created by
Jesse Maseto
on 2016-10-10 14:09:29 UTC
(
hide
)
Description:
Bug 14764: OPAC news selector - Template tags
Filename:
MIME Type:
Creator:
Jesse Maseto
Created:
2016-10-10 14:09:29 UTC
Size:
4.26 KB
patch
obsolete
>From 7fbc7752bb3cad7102ba6b352c4653e9dc8c691a Mon Sep 17 00:00:00 2001 >From: Martin Persson <xarragon@gmail.com> >Date: Thu, 15 Sep 2016 14:26:56 +1200 >Subject: [PATCH] Bug 14764: OPAC news selector - Template tags > >Test plan: > >1) Add more than one library, at least two in total is needed. Make note of which is your current user's home branch. >2) Go to Tools -> News and add one global ("All") news item and one specific for each branch. >3) Apply the patches. >4) Perform database upgrades when you log in. >5) Go to OPAC main, it should work as before: Showing global news as well as the news for your home branch once logged in. >6) Go to System Preferences -> OPAC and set 'OPACNewsBranchSelect' to yes. >7) Go to OPAC main, you should see the global news item plus any items for your home branch for the current user if logged in. >8) Above the news, you will see a dropdown that lists the branches. Select one, and click "Change library." >9) You should now see global news and the news for the selected branch, regardless of whether logged in or not. > >Sponsored-By: Halland County Library > >Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> >--- > .../bootstrap/en/includes/opac-bottom.inc | 8 ++++++++ > .../opac-tmpl/bootstrap/en/modules/opac-main.tt | 24 +++++++++++++++++++++- > 2 files changed, 31 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 1a13370..9be4768 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -267,6 +267,14 @@ $.widget.bridge('uitooltip', $.ui.tooltip); > </script> > [% END # / IF persona %] > >+[% IF Koha.Preference( 'OpacNewsBranchSelect' ) == 1 %] >+<script type="text/javascript"> >+ $("#news-branch-select").change(function() { >+ $( "#news-branch-select" ).submit(); >+ }); >+</script> >+[% END %] >+ > <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script> > <script type="text/javascript"> > $(document).ready(function() { >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 2ec85cf..c1261f0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -37,8 +37,21 @@ > [% ELSE %] > <div class="span9"> > [% END %] >+ [% IF Koha.Preference( 'OpacNewsBranchSelect' ) == 1 %] >+ <form id="news-branch-select" class="form-inline" method="get" action="/cgi-bin/koha/opac-main.pl"> >+ <label for="news-branch">See news for </label> >+ <select id="news-branch" name="branch"> >+ <option selected="selected">Select a library</option> >+ [% FOREACH BranchesLoo IN Branches.all %] >+ <option value="[% BranchesLoo.branchcode %]">[% BranchesLoo.branchname %]</option> >+ [% END %] >+ <option value="">System-wide only</option> >+ </select> >+ </form> >+ [% END %] > > [% IF ( koha_news_count ) %] >+ > <div id="news" class="newscontainer"> > [% SET newsdisp = ( Koha.Preference('NewsAuthorDisplay') ) %] > [% FOREACH koha_new IN koha_news %] >@@ -54,7 +67,16 @@ > <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-news-rss.pl?branchcode=[% branchcode %]"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png"></a> > RSS feed for [% IF ( branchcode ) %][% Branches.GetName( branchcode ) %] <i>and</i> [% END %] system-wide library news. > </div> >- [% END %] >+ [% ELSE %] >+ [% IF Koha.Preference( 'OpacNewsBranchSelect' ) == 1 %] >+ <div id="news" class="newscontainer"> >+ <div class="newsitem"> >+ <div class="newsbody">No news to display.</div> >+ <div class="newsfooter"></div> >+ </div> >+ </div> >+ [% END %] >+ [% END %] > > [% IF ( display_daily_quote && daily_quote ) %] > <div id="daily-quote"> >-- >2.1.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 14764
:
42129
|
42130
|
42131
|
42132
|
42139
|
42146
|
42147
|
55679
|
55680
|
55681
|
55682
|
55724
|
55725
|
55726
|
56107
|
56108
|
56109
|
57058
|
57059
|
57060
|
57061
|
57062
|
57063
|
57110
|
59648
|
59653
|
59827
|
60396
|
60424
|
60425
|
60451
|
60452