Bug 15072: Breadcrumbs and titles inconsistent in Label creator
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 27 Oct 2015 18:15:16 +0000 (15:15 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 30 Oct 2015 12:57:22 +0000 (09:57 -0300)
This patch makes the page title and breadcrumbs more consistent.
It does so by removing some text (Manage...) and using Edit (id) and Create
on building both the breadcrumbs and titles.

To test:
- Traverse all the Label creator options
=> FAIL: the texts are not consistent and don't match what we use in the patron card creator.
- Apply the patch
=> SUCCESS: Terminology is consistent, titles and breadcrumbs show the same information
- Sign off :-D

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt
koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt
labels/label-manage.pl

index 61485a9..27fb318 100644 (file)
@@ -1,6 +1,6 @@
 [% USE ItemTypes %]
     [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Manage label batches</title>
+    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Batches &rsaquo; [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]Create[% END %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
     [% INCLUDE 'greybox.inc' %]
     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; 
         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
-        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Manage label batches</a> &rsaquo;
+        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> &rsaquo;
         [% IF batch_id %]
-            Manage batch number [% batch_id %]
+            Edit ([% batch_id %])
         [% ELSE %]
-            Create new batch
+            Create
         [% END %]
     </div>
     <div id="doc3" class="yui-t2">
index f36bdab..5e813a0 100644 (file)
@@ -8,7 +8,7 @@
 [%  END %]
 [% END %]
     [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Manage label layouts</title>
+    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Layouts &rsaquo; [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]Create[% END %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
     <script type="text/JavaScript" language="JavaScript">
         //<![CDATA[
@@ -51,8 +51,8 @@
         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
-        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Manage label layouts</a> &rsaquo;
-        [% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] Label layout
+        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=layout">Layouts</a> &rsaquo;
+        [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]Create[% END %]
     </div>
     <div id="doc3" class="yui-t2">
         <div id="bd">
@@ -66,7 +66,7 @@
                     </div>
                     <form name="input" action="/cgi-bin/koha/labels/label-edit-layout.pl" method="get">
                         <fieldset class="rows">
-                            <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] Label layout</legend>
+                            <legend>[% IF ( layout_id ) %]Edit[% ELSE %]Create[% END %] label layout</legend>
                             <ol>
                                 <li>
                                     <label for="layout_name">Layout name: </label>
index 5fb86a6..9318b85 100644 (file)
@@ -1,5 +1,5 @@
     [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Printer profiles</title>
+    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Profiles &rsaquo; [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]Create[% END%]</title>
     [% INCLUDE 'doc-head-close.inc' %]
        <script type="text/javascript">
         //<![CDATA[
@@ -43,8 +43,8 @@
         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
-        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=profile">Printer profiles</a> &rsaquo;
-        Edit printer profile
+        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=profile">Profiles</a> &rsaquo;
+        [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]Create[% END%]
     </div>
     <div id="doc3" class="yui-t2">
         <div id="bd">
index 051d945..a7f2c3a 100644 (file)
@@ -1,5 +1,5 @@
     [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Label templates</title>
+    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Templates &rsaquo; [% IF ( template_id ) %]Edit ([% template_id %])[% ELSE %]Create[% END %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
        <script type="text/javascript">
         //<![CDATA[
@@ -43,8 +43,8 @@
         <a href="/cgi-bin/koha/mainpage.pl">Home</a>&rsaquo;
         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>&rsaquo;
         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a>&rsaquo;
-        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Label templates</a>&rsaquo;
-        Edit label template
+        <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=template">Templates</a>&rsaquo;
+        [% IF ( template_id ) %]Edit ([% template_id %])[% ELSE %]Create[% END %]
     </div>
     <div id="doc3" class="yui-t2">
         <div id="bd">
index 6a47457..dfa17de 100644 (file)
@@ -1,5 +1,17 @@
+[% BLOCK translate_label_element %]
+[%-  SWITCH element -%]
+[%-  CASE 'layout'    -%]layout
+[%-  CASE 'Layouts'   -%]Layouts
+[%-  CASE 'template'  -%]template
+[%-  CASE 'Templates' -%]Templates
+[%-  CASE 'profile'   -%]profile
+[%-  CASE 'Profiles'  -%]Profiles
+[%-  CASE 'batch'     -%]batch
+[%-  CASE 'Batches'   -%]Batches
+[%-  END -%]
+[% END %]
     [% INCLUDE 'doc-head-open.inc' %]
-    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; Manage label</title>
+    <title>Koha &rsaquo; Tools &rsaquo; Label creator &rsaquo; [% PROCESS translate_label_element element=label_element_title %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
     [% INCLUDE 'greybox.inc' %]
     <script type="text/javascript">
@@ -77,7 +89,7 @@
         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
         <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> &rsaquo;
-        Manage label [% label_element_title %]
+        [% PROCESS translate_label_element element=label_element_title %]
     </div>
     <div id="doc3" class="yui-t2">
         <div id="bd">
index aba2862..58feb0e 100644 (file)
@@ -11,6 +11,7 @@
 [%-  CASE 'Actions'   -%]Actions
 [%-  END -%]
 [% END %]
+
     [% INCLUDE 'doc-head-open.inc' %]
     <title>Koha &rsaquo; Tools &rsaquo; Patron card creator &rsaquo; [% PROCESS translate_card_element element=card_element_title %]</title>
     [% INCLUDE 'doc-head-close.inc' %]
index bee2473..3399c8f 100755 (executable)
@@ -18,8 +18,8 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
+
 use vars qw($debug);
 
 use CGI qw ( -utf8 );
@@ -98,10 +98,16 @@ my $table = html_table($display_columns->{$label_element}, $db_rows);
 $template->param(error => $error) if ($error) && ($error ne 0);
 $template->param(print => 1) if ($label_element eq 'batch');
 $template->param(
-                op              => $op,
-                element_id      => $element_id,
-                table_loop      => $table,
-                label_element   => $label_element,
+    op              => $op,
+    element_id      => $element_id,
+    table_loop      => $table,
+    label_element   => $label_element,
+    label_element_title => (
+        $label_element eq 'layout'   ? 'Layouts' :
+        $label_element eq 'template' ? 'Templates' :
+        $label_element eq 'profile'  ? 'Profiles' :
+        $label_element eq 'batch'    ? 'Batches' :
+        '' )
 );
 
 output_html_with_http_headers $cgi, $cookie, $template->output;