Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt
Owen Leonard 3be7ff5679
Bug 33916: Improve translation of title tags: Labels
This patch label creator templates so that title tags can be more easily
translated.

The patch also makes some minor changes to some templates to improve
consistency between page title, breadcrumb navigation, and page heading.

To test, apply the patch and confirm that the following pages have the
correct title tags:

- Cataloging -> Label creator home
  - Manage -> Label batches
    - Edit ->
      - Click the "Add item(s)" button without entering any barcodes or
        item numbers in the form.
        - Test the search form and search results
  - Manage -> Layouts
  - Manage -> Label templates
  - Manage -> Printer profiles
  - New -> Label batch
  - New -> Layout
  - New -> Label template
  - New -> Printer profile
  - New -> Barcode range
- Cataloging -> Barcode image generator
- Cataloging -> Quick spine label creator

Signed-off-by: Salah Ghedda <salah.ghedda@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-10-20 17:38:31 -03:00

147 lines
5.6 KiB
Text

[% USE raw %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% t("Print barcode range") | html %] &rsaquo;
[% t("Label creator") | html %] &rsaquo;
[% t("Cataloging") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'greybox.inc' %]
</head>
<body id="labels_label-home" class="tools labels">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Print barcode range</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>
[% INCLUDE 'labels-toolbar.inc' %]
<h1>Print barcode range</h1>
<form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post">
<input type="hidden" name="op" value="add" />
<fieldset class="rows">
<ol>
<li>
<label for="from-input">From:</label>
<input type="text" inputmode="numeric" pattern="[0-9]*" name="from" id="from-input" value="0" style="text-align: right;"/>
</li>
<li>
<label for="to-input">To:</label>
<input type="text" inputmode="numeric" pattern="[0-9]*" name="to" id="to-input" value="0" style="text-align: right;"/>
</li>
</ol>
</fieldset>
<fieldset class="action">
<button type="button" class="btn btn-primary" id="print">Print range</button>
</fieldset>
</form>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'cat-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
</div> <!-- /.main.container-fluid -->
[% MACRO jsinclude BLOCK %]
<script>
function Xport() {
var str = "";
str += "from=" + document.getElementById("from-input").value + "&";
str += "to=" + document.getElementById("to-input").value;
return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800);
}
function checkTwoValue(_from, _to, _id){
var result = _from.length == _to.length;
if (_from[0] == "0" || _to[0] == "0") {
switch (_id){
case 'from-input':
var to_inp = $("#to-input")
if (to_inp.hasClass('error')){
to_inp.removeClass('error').addClass('valid');
$("to-input-error").remove();
}
if ($('#to-input-error').length){
$("#to-input-error").remove();
}
return result;
case 'to-input':
var from_inp = $("#from-input")
if (from_inp.hasClass('error')){
from_inp.removeClass('error').addClass('valid');
}
if ($('#from-input-error').length){
$("#from-input-error").remove();
}
return result;
}
}
return true;
}
$(document).ready(function () {
$('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current");
$.validator.addMethod("gt", function(value, element, params) {
return parseInt(value) >= parseInt($(params).val());
}, _("Must be greater or equal to the from value."));
$.validator.addMethod("eq", function(value, element, params) {
return checkTwoValue($("#from-input").val(), $("#to-input").val(), $(element).attr('id'));
}, _("From and to values must have the same length."));
$("form[name=add_by_number]").validate({
rules: {
from: {
required: true,
eq: "#from-input",
eq: "#to-input",
},
to: {
required: true,
gt: "#from-input",
eq: "#from-input",
eq: "#to-input",
}
}
});
$("#print").on("click", function () {
if ( $("form[name=add_by_number]").valid() ) {
return Xport();
}
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]