Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt
Tomas Cohen Arazi 1bc7e5a645 Bug 26262: Remove wrong dom setting in course reserves (OPAC)
The current setting required pagination to be displayed. This was hidden
probably as a side effect of styling settings. But the docs are clear on
the fact that p and l are intended for displaying pagination controls
and table rows lenght information [1]

As the course reserves datatable is not paginated, this needs to be
fixed properly by removing those controls in the configuration. This
patch does so.

To test:
1. Have some course reserves
2. See them in the OPAC
=> FAIL: Some funky, misaligned pagination artifacts are displayed
3. Apply this patch and reload
=> SUCCESS: Things are back to normal!
4. Sign off :-D

[1] https://datatables.net/examples/basic_init/dom.html

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-09-18 11:08:35 +02:00

92 lines
3.8 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE TablesSettings %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Courses</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
[% Asset.css("css/datatables.css") | $raw %]
[% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-course-reserves' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav aria-label="breadcrumb">
<ul class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item" aria-current="page">
<a href="#">Course reserves</a>
</li>
</ul>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col order-first order-md-first order-lg-2">
<div id="courses" class="maincontent">
<h1>Courses</h1>
<table id="course_reserves_table" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Dept.</th>
<th>Course #</th>
<th>Section</th>
<th>Term</th>
<th>Instructors</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
[% FOREACH c IN courses %]
<tr>
<td><a href="opac-course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %]</a></td>
<td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department, 1 ) | html %]</td>
<td>[% c.course_number | html %]</td>
<td>[% c.section | html %]</td>
<td>[% AuthorisedValues.GetByCode( 'TERM' c.term, 1 ) | html %]</td>
<td>
[% FOREACH i IN c.instructors %]
<div class="instructor"><span class="inst_surname">[% i.surname | html %]</span>[% IF i.firstname %]<span class="instr_separator">, </span><span class="instr_firstname">[% i.firstname | html %]</span>[% END %]</div>
[% END %]
</td>
<td>[% c.public_note | $raw %]</td>
[% END %]
</tbody>
</table>
</div> <!-- / #courses -->
</div> <!-- / .col -->
</div> <!-- / .row -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
$(document).ready(function() {
columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'course_reserves_table', 'json' ) | $raw %]
KohaTable("#course_reserves_table", {
"dom": '<"top"f>rt<"clear">',
"sorting": [[ 1, "asc" ]],
"autoWidth": false,
"asColumnDefs": [
{ "aTargets": [ 1 ], "sType": "nsb-nse" },
],
"language": {
"search": "_INPUT_",
"searchPlaceholder": "Search courses"
}
}, columns_settings );
});
</script>
[% END %]