TPac: more template scrubbing and cleaning
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / prefs.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     WRAPPER "opac/parts/myopac/prefs_base.tt2";
3     myopac_page = "prefs";
4     prefs_page = 'personal' %]
5
6 <div id="acct_info_main">
7     <div id='myopac.expired.alert'
8          class='hide_me'
9          style='margin-bottom: 20px;'>
10         <table class='data_grid'
11                width='100%'>
12             <tbody>
13                 <tr>
14                     <td width='100%' class='red'>
15                         [% l("Your account expired on") %]
16                         <span id='myopac.expired.date'></span>!
17                         [% l("Please see a librarian to renew your account.") %]</td>
18                 </tr>
19             </tbody>
20         </table>
21     </div>
22
23     <div id='myopac.notes.div'
24          class='hide_me'>
25         <table class='data_grid'
26                width='100%'>
27             <thead>
28                 <tr>
29                     <td colspan='2'>
30                     <b>[% l("* Staff Notes *") %]</b></td>
31                 </tr>
32             </thead>
33
34             <tbody id='myopac.notes.tbody'>
35                 <tr id='myopac.notes.tr'>
36                     <td><b name='title'></b> : <span name=
37                     'value'></span></td>
38                 </tr>
39             </tbody>
40         </table><br />
41     </div>
42
43     <table width='70%'
44            class='light_border data_grid'>
45         <tbody id='myopac_summary_tbody'>
46             <tr>
47                 <td width='30%'
48                     class='color_4 light_border'>[% l("Name") %]</td>
49
50                 <td class='light_border'>[% l(
51                     HUMAN_NAME_FORMAT,
52                     ctx.user.prefix, ctx.user.first_given_name,
53                     ctx.user.second_given_name, ctx.user.family_name,
54                     ctx.user.suffix
55                 ) | html %]</td>
56
57                 <td></td>
58             </tr>
59
60             <tr>
61                 <td class='color_4 light_border'>[% l("Day Phone") %]</td>
62                 <td class='light_border'>[% ctx.user.day_phone | html %]</td>
63                 <td></td>
64             </tr>
65
66             <tr>
67                 <td class='color_4 light_border'>[% l("Evening Phone") %]</td>
68                 <td class='light_border'>[% ctx.user.evening_phone | html %]</td>
69                 <td></td>
70             </tr>
71
72             <tr>
73                 <td class='color_4 light_border'>[% l("Other Phone") %]</td>
74                 <td class='light_border'>[% ctx.user.other_phone | html %]</td>
75                 <td></td>
76             </tr>
77
78             <tr>
79                 <td class='color_4 light_border'>
80                     <div style="position:absolute">
81                         <div class="hide_me" style="position:relative;left:70px;top:-3px;">
82                             <a href="#"><img alt="Username Help" src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
83                         </div>
84                     </div>[% l("Username") %]
85                 </td>
86                 <td class='light_border'>[% ctx.user.usrname | html %]</td>
87                 <td class='light_border'><a href='update_username'>[% l("Change") %]</a></td>
88             </tr>
89             <tr>
90                 <td class='color_4 light_border'>[% l("Password") %]</td>
91                 <td class='light_border'>[% l("(not shown)") %]</td>
92                 <td class='light_border'><a href='update_password'>[% l("Change") %]</a></td>
93             </tr>
94             <tr>
95                 <td class='color_4 light_border'>[% l("Email Address") %]</td>
96                 <td class='light_border'>[% ctx.user.email | html %]</td>
97                 <td class='light_border'><a href='update_email'>[% l('Change') %]</a></td>
98             </tr>
99
100             [% IF ctx.user.ident_value %]<tr class="hide_me">
101                 <td class='color_4 light_border'>
102                 [% l("Primary Identification") %]</td>
103
104                 <td class='light_border'>
105                     [%
106                     # l('[_1] ([_2])', ctx.user.ident_value, ctx.user.ident_type.name) | html
107                     # XXX uncomment the above line to show primary
108                     # identification. With a minor tweak it could
109                     # alternatively be shown but partially obscured. 
110                     %]
111                 </td>
112                 <td></td>
113             </tr>[% END %]
114
115             <tr>
116                 <td class='color_4 light_border'>[% l("Active Barcode") %]</td>
117                 <td class='light_border'>[% ctx.user.card.barcode %]</td>
118                 <td></td>
119             </tr>
120
121             <tr>
122                 <td class='color_4 light_border'>[% l("Home Library") %]</td>
123                 <td class='light_border'>[% ctx.user.home_ou.name | html %]</td>
124                 <td></td>
125             </tr>
126             <tr>
127                 <td class='color_4 light_border'>[% l("Account Creation Date") %]</td>
128                 <td class='light_border'>[% date.format(ctx.parse_datetime(ctx.user.create_date), DATE_FORMAT) %]</td>
129                 <td></td>
130             </tr>
131         </tbody>
132     </table><br />
133     <hr class='opac-auto-013' color="#DCDBDB" />
134     <br />
135
136     <table width='100%' class='light_border data_grid'>
137         <thead>
138             <tr>
139                 <td><strong>[% l("Addresses") %]</strong></td>
140                 <td><strong>[% l("Pending Addresses") %]</strong></td>
141             </tr>
142         </thead>
143         <tbody>
144             [% 
145                 # cycle through the non-pending address.  For each non-pending addr
146                 # that has a corresponding pending addr, render the pending addr 
147                 # along the right inside it's own edit form
148                 pending = {};
149                 regular = [];
150                 edit_addr_id = CGI.param('edit_address');
151                 FOR addr IN ctx.user.addresses;
152                     IF addr.pending == 't';
153                         replaces = addr.replaces;
154                         pending.$replaces = addr;
155                     ELSE;
156                         regular.push(addr);
157                     END;
158                 END;
159             FOR addr IN regular;
160                 cur_id = addr.id; 
161                 pending_addr = pending.$cur_id;
162             %]
163             <tr>
164                 <td>
165                     <!-- read-only address display -->
166                     <table class='light_border'>
167                         <tr><td>[% l("Address Type") %]</td><td>[% addr.address_type | html %]</td></tr>
168                         <tr><td>[% l("Street") %]</td><td>[% addr.street1 | html %]</td></tr>
169                         <tr><td>[% l("Street") %]</td><td>[% addr.street2 | html %]</td></tr>
170                         <tr><td>[% l("City") %]</td><td>[% addr.city | html %]</td></tr>
171                         <tr><td>[% l("County") %]</td><td>[% addr.county| html  %]</td></tr>
172                         <tr><td>[% l("State") %]</td><td>[% addr.state | html %]</td></tr>
173                         <tr><td>[% l("Country") %]</td><td>[% addr.country | html %]</td></tr>
174                         <tr><td>[% l("Zip") %]</td><td>[% addr.post_code | html %]</td></tr>
175                         [% IF ctx.get_org_setting(ctx.user.home_ou.id, 'opac.allow_pending_address') 
176                                 AND !pending_addr AND edit_addr_id != cur_id %]
177                         <tr>
178                             <td colspan='2'>
179                                 <a href='?edit_address=[% addr.id %]'>[% l('Edit Address') %]</a>
180                             </td>
181                         </tr>
182                         [% END %]
183                     </table>
184                 </td>
185
186                 <!-- pending address form -->
187                 [% IF pending_addr OR edit_addr_id == cur_id;
188                     update_addr = pending_addr || addr %]
189                 <td>
190                     <form method='POST'>
191                         [% IF pending_addr %]
192                             <input type='hidden' name='pending_addr' value='[% pending_addr.id %]'/>
193                         [% ELSE %]
194                             <input type='hidden' name='replace_addr' value='[% edit_addr_id | html %]'/>
195                         [% END %]
196                         <table class='pending-addr'>
197                             <tr>
198                                 <td>[% l("Address Type") %]</td>
199                                 <td><input name='address_type' value='[% update_addr.address_type | html %]'/></td>
200                             </tr>
201                             <tr>
202                                 <td>[% l("Street") %]</td>
203                                 <td><input name='street1' value='[% update_addr.street1 | html %]'/></td>
204                             </tr>
205                             <tr>
206                                 <td>[% l("Street") %]</td>
207                                 <td><input name='street2' value='[% update_addr.street2 | html %]'/></td>
208                             </tr>
209                             <tr>
210                                 <td>[% l("City") %]</td>
211                                 <td><input name='city' value='[% update_addr.city | html %]'/></td>
212                             </tr>
213                             <tr>
214                                 <td>[% l("County") %]</td>
215                                 <td><input name='county' value='[% update_addr.county| html %]'/></td>
216                             </tr>
217                             <tr>
218                                 <td>[% l("State") %]</td>
219                                 <td><input name='state' value='[% update_addr.state | html %]'</td>
220                             </tr>
221                             <tr>
222                                 <td>[% l("Country") %]</td>
223                                 <td><input name='country' value='[% update_addr.country | html %]'/></td>
224                             </tr>
225
226                             <tr>
227                                 <td>[% l("Zip") %]</td>
228                                 <td><input name='post_code' value='[% update_addr.post_code | html %]'/></td>
229                             </tr>
230                             <tr>
231                                 <td><input type='submit' value="[% l('Save Changes') %]"/></td>
232                                 <td>
233                                     [% params = (pending_addr) ? {delete_pending => pending_addr.id} : {} %]
234                                     <a href="[% mkurl('', params, 1) %]">[% l('Discard Pending Address') %]</a>
235                                 </td>
236                             </tr>
237                             <tr><td colspan='2'><i>[% l('Address changes will be verified by staff') %]</i></td></tr>
238                         </table>
239                     </form>
240                 </td>
241                 [% END %] <!-- if pending_addr -->
242             </tr>
243             [% END %]
244         </tbody>
245     </table>
246 </div>
247
248 [% END %]