Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt
Julian Maurice ed7543287b Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
Having to write [% KOHA_VERSION %] for each url is bad because:
- It's easily forgettable when adding new <script> or <link>
- It prevents grep'ing for the full filename
- It violates the DRY principle
- If at some point we want to change the "force js and css reload"
  mechanism, it will be tedious

This patch:
- adds a Template::Toolkit plugin that generates <script> and
  <link> tags for JS and CSS files, and inserts automatically the Koha
  version in the filename
- use the new plugin to remove all occurences of [% KOHA_VERSION %]
- remove the code that was adding KOHA_VERSION as a template variable

Test plan:
1. Apply patch
2. Go to several different pages in Koha (opac and intranet) while
   checking your browser's dev tools (there should be no 404 for JS and
   CSS files, and the Koha version should appear in filenames) and the
   server logs (there should be no "File not found")
3. `git grep KOHA_VERSION` should return nothing
4. prove t/db_dependent/Koha/Template/Plugin/Asset.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-13 11:49:44 -03:00

73 lines
2.5 KiB
Text

[% USE Asset %]
[% USE Branches %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Pending discharge requests</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
</head>
<body id="pat_discharges" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Pending discharge requests</div>
<div class="main container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
[% IF pending_discharges %]
<h2>Pending discharge requests</h2>
<div id="pending_updates">
<table>
<thead>
<tr>
<th>Patron</th>
<th>Library</th>
<th class="title-string">Date requested</th>
<th>Allow</th>
</tr>
</thead>
<tbody>
[% FOREACH d IN pending_discharges %]
<tr>
<td><a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% d.borrower.borrowernumber %]">[% d.borrower.surname %], [% d.borrower.firstname %]</a></td>
<td>[% d.borrower.branchcode.branchname %]</td>
<td><span title="[% d.needed %]">[% d.needed | $KohaDates %]</span></td>
<td><a class="btn btn-xs btn-default" href="/cgi-bin/koha/members/discharges.pl?op=allow&borrowernumber=[% d.borrower.borrowernumber %]"><i class="fa fa-check"></i> Allow</a></td>
</tr>
[% END %]
</tbody>
</table>
</div>
[% ELSE %]
<div class="dialog message">
<p>There are no pending discharge requests.</p>
</div>
[% END %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/members-menu.js") %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {
$('#pending_updates table').DataTable($.extend(true, {}, dataTablesDefaults, {
paging: false,
info: true,
searching: true,
order: [[2, "asc"]],
columnDefs: [
{ targets: -1, orderable: false },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
],
}));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]