Koha/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-reserves.tt
Owen Leonard 247dca3064
Bug 23013: Upgrade DataTables in the staff client
This patch upgrades DataTables and makes some style changes to the
default DataTables toolbar style. DataTables assets are now combined and
minified using their download customizer, bundling together these
elements:

 - JSZip 2.5.0
 - pdfmake 0.1.36
 - DataTables 1.10.18
 - Buttons 1.5.6
 - Column visibility 1.5.6
 - HTML5 export 1.5.6
 - Print view 1.5.6
 - FixedHeader 3.1.4

DataTables assets have been moved from lib/jquery/plugins to
lib/datatables. The global header and footer include files are updated
correspondingly.

This patch removes the custom "four_button" pagination configuration and
updates pages which used it to use the built-in "full" type instead.
This is done for the sake of consistency and upgradability. This change
touches a lot of files.

Table-specific CSS has been moved from staff-global.scss to a new
include, _tables.scss. A second common include, _mixins.scss has some
variable definitions used in both files.

Many images have been made obsolete by this change and have been
removed.

To test, apply the patch and regenerate the staff client CSS. View
various pages in the staff client with tables:

 - Not formatted by DataTables:
   - Reports -> Most circulated items
   - Catalog -> Search results
 - Formatted by DataTables without column configuration
   - Acquisitions -> Vendor search
   - Lists
 - Formatted by DataTables with column configuration
   - Administration -> Libraries
   - Administration -> Item types
   - Reports -> Saved SQL reports
 - Non-standard DataTables configurations:
   - Circulation -> Checkouts
   - Administration -> System preferences
   - Reports -> Lost items

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-22 15:23:19 +01:00

92 lines
4.1 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
[% USE ColumnsSettings %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Course reserves</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="courses_course_reserves" class="course">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/course_reserves/course-reserves.pl">Course reserves</a></div>
<div class="main container-fluid">
<div class="row">
<div class="col-md-10 col-md-offset-1">
[% IF CAN_user_coursereserves_add_reserves OR CAN_user_coursereserves_manage_courses OR CAN_user_coursereserves_manage_courses %]
<div id="toolbar">
[% IF ( CAN_user_coursereserves_manage_courses ) %]
<a class="btn btn-default" id="new_course" href="/cgi-bin/koha/course_reserves/course.pl"><i class="fa fa-plus"></i> New course</a>
[% END %]
</div><!-- /toolbar -->
[% END %]
<h1>Courses</h1>
<table id="course_reserves_table">
<thead>
<tr>
<th>Name</th>
<th>Dept.</th>
<th>Course #</th>
<th>Section</th>
<th>Term</th>
<th>Instructors</th>
<th>Staff note</th>
<th>Public note</th>
<th># of students</th>
<th>Enabled</th>
</tr>
</thead>
<tbody>
[% FOREACH c IN courses %]
<tr>
<td><a href="course-details.pl?course_id=[% c.course_id | uri %]">[% c.course_name | html %]</a></td>
<td>[% AuthorisedValues.GetByCode( 'DEPARTMENT', c.department ) | html %]</td>
<td>[% c.course_number | html %]</td>
<td>[% c.section | html %]</td>
<td>[% AuthorisedValues.GetByCode( 'TERM' c.term ) | html %]</td>
<td>
[% FOREACH i IN c.instructors %]
<div class="instructor"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% i.borrowernumber | uri %]">[% i.firstname | html %] [% i.surname | html %]</a></div>
[% END %]
</td>
<td>[% c.staff_note | html %]</td>
<td>[% c.public_note | $raw %]</td>
<td>[% c.students_count | html %]</td>
<td>
[% IF c.enabled == 'yes' %]
Yes
[% ELSE %]
No
[% END %]
</td>
[% END %]
</tbody>
</table>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
var columns_settings = [% ColumnsSettings.GetColumns( 'coursereserves', 'courses', 'course_reserves_table', 'json' ) | $raw %];
$(document).ready(function() {
var ctable = KohaTable("course_reserves_table", {
"sPaginationType": "full",
"bAutoWidth": false
}, columns_settings );
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]