Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt
Marc Véron 6246f2c700 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:
<body ID="opac-main" class="branch-default" >
If logged in at branch FFL, it displays:
<body ID="opac-main" class="branch-FFL" >

If you log in, opac-user.pl should display
<body ID="opac-user" class="branch-FFL scrollto" >

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 <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-09-23 15:39:31 -03:00

185 lines
12 KiB
Text

[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Most popular titles
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
<style type="text/css">
#search-facets fieldset { border: 0; margin: 0;padding:.3em;}#search-facets ol{padding:.3em;}#search-facets li {list-style-type:none;padding:4px 4px;}#search-facets label{font-weight:bold;display:block;margin:.2em 0;}#search-facets fieldset.action {padding-left:4px;margin:.3em;};
</style>
[% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-topissues' bodyclass='scrollto' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li><a href="#">Most popular titles</a></li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
[% IF ( results_loop ) %]
<div id="usertopissues">
[% INCLUDE 'opac-topissues.inc' %]
[% IF ( OpacNav || OpacNavBottom ) %]
[% INCLUDE 'navigation.inc' %]
[% END %]
</div>
[% ELSE %]
[% IF ( OpacNav || OpacNavBottom ) %]
<div id="leftmenus">
[% INCLUDE 'navigation.inc' %]
</div>
[% END %]
[% END %]
</div>
<div class="span10">
<div id="topissues" class="maincontent">
[% IF ( results_loop ) %]
<table id="topissuest" class="table table-bordered table-striped">
<caption>
The [% limit %] most checked-out
[% IF ( itemtype ) %]
[% itemtype %]
[% END %]
[% IF ( branch ) %]
at
[% branch %]
[% END %]
[% IF ( timeLimitFinite ) %]
in the past [% timeLimitFinite %] months
[% ELSE %] of all time[% END %]
</caption>
<thead>
<tr>
<th>Title</th>
<th>[% IF ( ccodesearch ) %]Collection[% ELSE %]Item type[% END %]</th>
<th>Checkouts</th>
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<th>&nbsp;</th>[% END %]
</tr>
</thead>
<tbody>
[% FOREACH results_loo IN results_loop %]
<tr>
<td><a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% results_loo.biblionumber %]">[% results_loo.title |html %]</a><p>[% results_loo.author %]
[% IF ( results_loo.publishercode ) %]- [% results_loo.publishercode %][% END %] [% IF ( results_loo.seriestitle ) %]([% results_loo.seriestitle %])[% END %]
[% IF ( results_loo.place ) %][% results_loo.place %][% END %]
[% IF ( results_loo.publicationyear ) %]
[% results_loo.publicationyear %]
[% ELSIF ( results_loo.copyrightdate ) %]
[% results_loo.copyrightdate %]
[% END %]
[% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
[% IF ( results_loo.size ) %][% results_loo.size %][% END %]</p>
</td>
<td>
[% IF ( results_loo.description ) %]
<span class="tdlabel">
[% IF ( ccodesearch ) %]
Collection
[% ELSE %]
Item type
[% END %]:
</span>
[% results_loo.description %]
[% END %]
</td>
<td><span class="tdlabel">Checkouts: </span> [% results_loo.tot %]</td>
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<td>[% IF Koha.Preference( 'RequestOnOpac' ) == 1 %][% UNLESS ( results_loo.norequests ) %]<a href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% results_loo.biblionumber %]">Place hold</a>[% END %][% END %]</td>[% END %]
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<form method="post" action="/cgi-bin/koha/opac-topissues.pl">
<fieldset class="rows">
<legend>See the most popular titles</legend>
<ol>
<li><label for="limit">Show the top </label> <select name="limit" id="limit">
[% IF ( limit == 10 ) %]<option value ="10" selected="selected">10 titles</option>[% ELSE %]<option value="10">10 titles</option>[% END %]
[% IF ( limit == 15 ) %]<option value ="15" selected="selected">15 titles</option>[% ELSE %]<option value="15">15 titles</option>[% END %]
[% IF ( limit == 20 ) %]<option value ="20" selected="selected">20 titles</option>[% ELSE %]<option value="20">20 titles</option>[% END %]
[% IF ( limit == 30 ) %]<option value ="30" selected="selected">30 titles</option>[% ELSE %]<option value="30">30 titles</option>[% END %]
[% IF ( limit == 40 ) %]<option value ="40" selected="selected">40 titles</option>[% ELSE %]<option value="40">40 titles</option>[% END %]
[% IF ( limit == 50 ) %]<option value ="50" selected="selected">50 titles</option>[% ELSE %]<option value="50">50 titles</option>[% END %]
[% IF ( limit == 100 ) %]<option value ="100" selected="selected">100 titles</option>[% ELSE %]<option value="100">100 titles</option>[% END %]
</select>
</li>
<li>
<label for="branch">From: </label>
<select name="branch" id="branch">
<option value="">All libraries</option>
[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label for="itemtype">Limit to: </label>
<select name="itemtype" id="itemtype">
[% IF ( ccodesearch ) %]
<option value="">All collections</option>
[% ELSE %]
<option value="">All item types</option>
[% END %]
[% FOREACH itemtypeloo IN itemtypeloop %]
[% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.value %]" selected="selected">[% ELSE %]<option value="[% itemtypeloo.value %]">[% END %]
[% itemtypeloo.description %]
</option>
[% END %]
</select>
</li>
<li>
<label for="timeLimit">of the last:</label>
<select name="timeLimit" id="timeLimit">
[% IF ( timeLimit == 3 ) %]<option value="3" selected="selected">3 months</option>[% ELSE %]<option value="3">3 months</option>[% END %]
[% IF ( timeLimit == 6 ) %]<option value="6" selected="selected">6 months</option>[% ELSE %]<option value="6">6 months</option>[% END %]
[% IF ( timeLimit == 12 ) %]<option value="12" selected="selected">12 months</option>[% ELSE %]<option value="12">12 months</option>[% END %]
[% IF ( timeLimit == 999 ) %]<option value="999" selected="selected">No limit</option>[% ELSE %]<option value="999">No limit</option>[% END %]
</select>
</li>
</ol>
<input type="hidden" name="do_it" value="1" />
</fieldset>
<fieldset class="action">
<input type="submit" class="btn" value="Submit" />
</fieldset>
</form>
[% END # / IF results_loop %]
</div> <!-- / #topissues -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
$(function() {
$("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [ [2, "desc"], [0, "asc"] ],
"aoColumnDefs": [
[% IF ( opacuserlogin ) %]{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }[% END %]
],
"aoColumns": [
{ "sType": "anti-the" },
null,
null,
[% IF ( opacuserlogin ) %]null,[% END %]
]
}));
});
function Dopop(link) {
newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
}
//]]>
</script>
[% END %]