]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/myopac/prefs_notify.tt2
LP1778972 A slew of updates
[Evergreen.git] / Open-ILS / src / templates-bootstrap / opac / myopac / prefs_notify.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     WRAPPER "opac/parts/myopac/base.tt2";
3     myopac_page = "prefs_notify";
4     parent="prefs";
5     prefs_page = 'prefs_notify' %]
6
7 <h3>[% l('Notification Preferences') %]</h3>
8 <form method='post'>
9     [% setting = 'opac.hold_notify' %]
10     <input name='[% setting %]' type="hidden"
11         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
12
13     <table class="full-width table" id="acct_search_main" 
14         title="[% l('Notification Preferences') %]">
15         <tbody>
16
17             [% IF ctx.updated_user_settings %]
18             <tr><td colspan='2'>
19                 <div class='renew-summary'>
20                     [% l('Account Successfully Updated') %]
21                 </div>
22             </td></tr>
23             [% END %]
24
25             [% setting = 'opac.hold_notify' %]
26             <tr>
27                 [%# WCAG insists that labels for checkboxes contain the input
28                     or directly follow the input, which would not look right
29                     with the rest of the table.  As an alternative, we can
30                     repeat the label as a title attr.
31                     http://www.w3.org/TR/WCAG20-TECHS/H44.html %]
32                 [% email_label = l('Notify by Email by default when a hold is ready for pickup?') %]
33
34                 <td><label for='[% setting %].email'>[% email_label %]</label></td>
35                 <td>
36                     <input id='[% setting %].email' name='[% setting %].email' 
37                         type="checkbox" title="[% email_label %]"
38                         [% IF (matches = ctx.user_setting_map.$setting.match('email')); %] checked='checked' [% END %]/>
39                 </td>
40             </tr>
41             [%- IF allow_phone_notifications == 'true';
42                 setting = 'opac.hold_notify'; 
43             -%]
44             <tr>
45                 [% phone_label = l('Notify by Phone by default when a hold is ready for pickup?') %]
46                 <td><label for='[% setting %].phone'>[% phone_label %]</label></td>
47                 <td>
48                     <input id='[% setting %].phone' name='[% setting %].phone' 
49                         type="checkbox" title="[% phone_label %]"
50                         [% IF (matches = ctx.user_setting_map.$setting.match('phone')); %] checked='checked' [% END %]/>
51                 </td>
52             </tr>
53             [% setting = 'opac.default_phone' %]
54             <tr>
55                 <td><label for='[% setting %]'>[% l('Default Phone Number') %]</label></td>
56                 <td>
57                     <input id='[% setting %]' name='[% setting %]' type="text"
58                         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %] class="form-control"/>
59                 </td>
60             </tr>
61             [%- END %]
62             [%- IF ctx.get_org_setting(ctx.search_ou, 'sms.enable') == 1;
63                setting = 'opac.hold_notify';
64             -%]
65             <tr>
66                 [% sms_label = l('Notify by Text by default when a hold is ready for pickup?') %]
67                 <td><label for='[% setting %].sms'>[% sms_label %]</label></td>
68                 <td>
69                     <input id='[% setting %].sms' name='[% setting %].sms' 
70                         type="checkbox" title="[% sms_label %]"
71                         [% IF (matches = ctx.user_setting_map.$setting.match('sms')); %] checked='checked' [% END %]/>
72                 </td>
73             </tr>
74             <tr>
75                 <td>[% l('Default Mobile Carrier') %]</td>
76                 <td>[% INCLUDE "opac/parts/sms_carrier_selector.tt2" sms_carrier_hide_label="true" %]</td>
77             </tr>
78             [% setting = 'opac.default_sms_notify' %]
79             <tr>
80                 <td><label for='[% setting %]'>[% l('Default Mobile Number') %]</label></td>
81                 <td>
82                     <input id='[% setting %]' name='[% setting %]' type="text"
83                         [% IF ctx.user_setting_map.$setting; %] value='[% ctx.user_setting_map.$setting | html %]' [% END %]/>
84                     [% l('Hint: use the full 10 digits of your phone #, no spaces, no dashes'); %]
85                 </td>
86             </tr>
87             [% END %]
88             [% FOR optin IN ctx.opt_in_settings %]
89             <tr>
90                 <td><label for='[% optin.cust.name | uri %]'>[% optin.cust.label | html %]</label></td>
91                 <td>
92                     <input type='checkbox' name='setting' 
93                         value='[% optin.cust.name | uri %]' 
94                         id='[% optin.cust.name | uri %]' 
95                         title="[% optin.cust.label | html %]"
96                         [% IF optin.value %] checked='checked' [% END %]/>
97                 </td>
98             </tr>
99             [% END %]
100         </tbody>
101     </table>
102
103     <button type='submit' class="btn btn-confirm"><i class="fas fa-save"></i> [% l('Save') %]</button>
104 </form>
105 [% END %]
106
107