LP1183414: OPAC patron opt-in settings table does not work correctly
authorPasi Kallinen <pasi.kallinen@pttk.fi>
Mon, 27 May 2013 09:02:38 +0000 (12:02 +0300)
committerBill Erickson <berick@esilibrary.com>
Wed, 10 Jul 2013 14:07:26 +0000 (10:07 -0400)
Fix the template logic error, trying to use a variable before
it is defined.

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/myopac/prefs_notify.tt2

index 43eed64..c0c1fba 100644 (file)
             [% END %]
         </tbody>
     </table>
-    <table>
+
+    <div class='user_opt_in_settings'>
+    [% IF ctx.opt_in_settings.size == 0 %]
+      <strong>[% l('No notification preferences are configured') %]</strong>
+    [% ELSE %]
+      <table>
         <thead><tr>
             <th>[% l('Notification Type') %]</th>
             <th>[% l('Enabled') %]</th>
         </tr></thead>
         <tbody class='data_grid'>
-            [% IF optin.size == 0 %]
-                <strong>[% l('No notification preferences are configured') %]</strong>
-            [% END %]
             [% FOR optin IN ctx.opt_in_settings %]
                 <tr>
                     <td>[% optin.cust.label | html %]</td>
                 </tr>
             [% END %]
         </tbody>
-    </table>
+      </table>
+    [% END %]
+    </div>
     <input type='submit' value="[% l('Save') %]" alt="[% l('Save') %]" class="opac-button" />
 </form>
 [% END %]