Lp 2008925: Patch Templates Adversely Affected by Lp 1992490
authorJason Stephenson <jason@sigio.com>
Wed, 1 Mar 2023 19:34:25 +0000 (14:34 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 2 Mar 2023 16:20:34 +0000 (11:20 -0500)
The patch for Lp 1992490 wrapped several text blocks in the l()
translation function.  At least two of these introduced syntax error
in Template Toolkit.  Some of the others could have been done
differntly to fit in better with the general idiom of how we use the
fuction in Evergreen.

This commit modifies those that stood out as the most egregious
examples.

An easy way to test this is to login to the OPAC on an unpatched
system and click to open "Messages."  You will get an Internal Server
Error.  After you apply this commit and install the affected
templates, you will not get an Internal Server Error.

The other modified templates do not seem to crash, but use the
translation funciton in idiosyncratic ways.  This commit attempts to
smooth those out.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/holds.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/messages/list.tt2
Open-ILS/src/templates-bootstrap/opac/register.tt2

index 7108f72..3de821e 100755 (executable)
                 [% c = c + 1; %]
                     [% IF myopac_cc_allowed %]
                     <td class="checkCell">
-                        <label class="sr-only">[% l('Billing Number') %] [% c %]</label>
+                        <label class="sr-only">[% l('Billing Number [_1]', c) %]</label>
                         <input aria-label="[% l('Pay This Bill') %]" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
                     </td>
                     [% END %]
index e6c38fd..898098f 100755 (executable)
                 <tr class="[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
                     <td class="checkbox_column">
 
-                    <span class="sr-only">[% l('Hold Number') %] [% cnt; %]</span>
+                    <span class="sr-only">[% l('Hold Number [_1]', cnt); %]</span>
                         <input type="checkbox" name="hold_id" value="[% ahr.id %]"
                             [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
                     </td>
index 902dda9..877b621 100755 (executable)
@@ -95,7 +95,7 @@
                 [% FOR message IN ctx.patron_messages; %]
                     <tr [% IF !message.is_read %]class="unread-patron-message"[% END %]>
                         <td class="checkCell">
-                            <span class="sr-only">[% l('Message Number') count; %]</span>
+                            <span class="sr-only">[% l('Message Number [_1]', count); %]</span>
                         <input type="checkbox" name="message_id" value="[% message.id %]"
                             [% html_text_attr('aria-label', l('Select message [_1]', message.title)) %]/>
                         </td>
                         </td>
                         <td>
                         <span class="sr-only">[% l('Message Options') %]</span>
-                            <a class="btn btn-sm btn-action" href="[% mkurl('messages', { single => 1, message_id => message.id } ) %]" title="[% l('Read) message.title | html %]"><i class="fas fa-glasses" aria-hidden="true"></i> [% l('Read') %]</a>
+                            <a class="btn btn-sm btn-action" href="[% mkurl('messages', { single => 1, message_id => message.id } ) %]" title="[% l('Read [_1]', message.title) | html %]"><i class="fas fa-glasses" aria-hidden="true"></i> [% l('Read') %]</a>
                         </td>
                     </tr>
                 [% END %]
index ef99c68..6c36abc 100755 (executable)
@@ -50,7 +50,7 @@ register_fields = [
 <div class="container">
     <div id="main-content-register">
         <h1>[% l('Request a Library Card')%]</h1>
-        <span class="validate">[% l('&bigstar; indicates Required Field') %]</span>
+        <span class="validate">&bigstar; [% l('indicates Required Field') %]</span>
         <hr/>
 
         [% IF ctx.register.success %]
@@ -172,7 +172,7 @@ FOR field_def IN register_fields;
             value='[% value || CGI.param(field_path) | html %]' [% IF require %]required[% END %]/>
      [% END %]
         <div class="invalid-feedback">
-          [% l('Please enter a') %] [% field_def.label | html %]
+          [% l('Please enter a [_1]', field_def.label) | html %]
         </div>
 
         </div>