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