Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt
Owen Leonard ca80bf67ce
Bug 33154: Tab WRAPPER follow-up: label text must be translatable
This patch updates templates which have already been updated to use the
new tab WRAPPER system for generating tab markup. Templates are changed
so that tab label strings are wrapped in <span> to make them
translatable.

The html_helpers include file is also updated so that the example code
in comments shows the right pattern (the breadcrumb example is similarly
corrected).

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files for some of the lines modified in the patch:

 - koha-tmpl/intranet-tmpl/prog/en/modules/about.tt:31
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt:69
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt:330
 - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt:141
 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt:118
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt:259
 - koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt:455
 - koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt:98

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-13 11:47:54 -03:00

226 lines
8.2 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Item circulation alerts &rsaquo; Administration &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
[% FILTER collapse %]
<style>
table.grid thead th {
vertical-align: bottom;
}
table.grid tbody th {
text-align: right;
}
table.grid tbody td {
font-size: xx-small;
}
table.grid tbody td.info {
background-color: #fff !important;
}
table.grid.active tbody td {
width: 10%;
cursor: pointer;
}
table.grid tbody td {
background-color: #cfc !important;
color: #111;
}
table.grid td.disabled {
background-color: #fcc !important;
}
table.grid td.default {
background-color: #f88 !important;
}
</style>
[% END %]
</head>
<body id="admin_item_circulation_alerts" class="admin">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Item circulation alerts</span>
[% END %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<div class="row">
<div class="col-sm-6">
<h1>Item circulation alerts</h1>
<h2>Select a library:</h2>
<form id="branch_selector" method="get" action="/cgi-bin/koha/admin/item_circulation_alerts.pl">
<select id="branch" name="branch">
<option value="*">Default</option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
</select>
<input type="submit" name="pick" class="btn btn-primary" value="Pick" />
</form>
</div>
<div class="col-sm-6">
<table class="grid">
<caption>Legend</caption>
<thead>
<tr>
<th>Color</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td width="100" class="default">&nbsp;</td>
<td class="info">These are disabled for ALL libraries. To change these settings, choose the "Default" library.</td>
</tr>
<tr>
<td class="disabled">&nbsp;</td>
<td class="info">These are disabled for the current library.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="info">These are enabled.</td>
</tr>
</tbody>
</table>
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
<h2>Circulation alerts for [% Branches.GetName( branch ) || 'Default' | html %]</h2>
<p>Click on the grid to toggle the settings.</p>
[% WRAPPER tabs id= "alerttabs" %]
[% WRAPPER tabs_nav %]
[% WRAPPER tab_item tabname= "checkout" bt_active= 1 %] <span>Checkout</span> [% END %]
[% WRAPPER tab_item tabname= "checkin" %] <span>Check-in</span> [% END %]
[% END %]
[% WRAPPER tab_panels %]
[% WRAPPER tab_panel tabname="checkout" bt_active= 1 %]
<h3>Checkout</h3>
<table class="grid active" width="100%">
<thead>
<tr>
<th>&nbsp;</th>
[% FOREACH item_type IN item_types %]
<th>[% item_type.description | html %]</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH grid_checkou IN grid_checkout %]
<tr>
<th>[% grid_checkou.description | html %]</th>
[% FOREACH item IN grid_checkou.items %]
<td class="[% item.class | html %]" id="[% item.id | html %]">[% item.text | html %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table> <!-- /.grid.active -->
[% END #/ #checkout %]
[% WRAPPER tab_panel tabname="checkin" %]
<h3>Check-in</h3>
<table class="grid active" width="100%">
<thead>
<tr>
<th>&nbsp;</th>
[% FOREACH item_type IN item_types %]
<th>[% item_type.description | html %]</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH grid_checki IN grid_checkin %]
<tr>
<th>[% grid_checki.description | html %]</th>
[% FOREACH item IN grid_checki.items %]
<td class="[% item.class | html %]" id="[% item.id | html %]">[% item.text | html %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
[% END # /#checkin %]
[% END # /.tab_panels %]
[% END # //#alerttabs %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'admin-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
<script>
var $branch = "[% branch | html %]";
$(function(){
var blocked = _("Blocked!");
var saving = _("Saving...");
var disabledForAll = _("Disabled for all");
var disabledForCurrent = _("Disabled for %s").format($branch);
$('#branch_selector input:submit').hide();
$('#branch').change(function(){
$('#branch_selector').submit();
});
$('table.grid.active tbody td').click(function(ev){
var id = this.id;
var td = $(this);
if (td.hasClass('default') && $branch != '*') {
td.html(blocked);
window.setTimeout(
function(){ td.html(disabledForAll) },
3000
);
} else {
td.html(saving);
$.ajax({
url : '/cgi-bin/koha/admin/item_circulation_alerts.pl',
type : 'POST',
dataType : 'json',
data : { action: 'toggle', id: id, branch: $branch },
success : function(response){
if ($branch == '*' && response.classes.match(/default/)) {
td.html(disabledForAll);
} else if (response.classes.match(/disabled/)) {
td.html(disabledForCurrent);
} else {
td.html(' ');
}
td.attr('class', response.classes);
}
});
}
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]