LP#1754110 Patron Reg. Field Label Override
authorKyle Huckins <khuckins@catalyte.io>
Wed, 7 Mar 2018 17:47:23 +0000 (17:47 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 30 Jul 2020 14:24:06 +0000 (10:24 -0400)
Supply additional parameter to draw_field_label macro to
apply custom labels to patron reg/edit fields.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2

index 1c66575..2fff639 100644 (file)
   </div>
 </div>
 
-[% MACRO draw_field_label (cls, field) BLOCK %]
+[%
+# draws a label for inputs based on the idl class's field's
+# label OR a supplied string
+MACRO draw_field_label (cls, field, label_override) BLOCK %]
   <div class="col-md-3 reg-field-label"> <!-- field label -->
-    <label>{{idl_fields.[% cls %].[% field %].label}}</label>
+    [% IF label_override %]<label>[% label_override %]</label>
+    [% ELSE %]<label>{{idl_fields.[% cls %].[% field %].label}}</label>[% END %]
     <!-- field documentation img/link -->
     <img ng-show="field_doc.[% cls %].[% field %]" 
       ng-click="set_selected_field_doc('[% cls %]','[% field %]')"