[ee46bc]: / Allura / allura / templates / update_emails_form.html  Maximize  Restore  History

Download this file

78 lines (74 with data), 2.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
{% for a in user.email_addresses %}
<input name="addr-{{loop.index0}}.ord" value="{{loop.index0}}" type="hidden"/>
{% endfor %}
<table class="grid-22">
<tr>
<th>Primary?</th>
<th>Address</th>
<th>Confirmed</th>
<th></th>
</tr>
{% for a in user.email_addresses %}
<tr>
{% set obj = user.address_object(a) %}
{% if obj.confirmed %}
<td>{{lib.radio_button('primary_addr', None, a, user.preferences.email_address)}}</td>
{% else %}
<td> <input type="radio" disabled="disabled"></td>
{% endif %}
<td>{{a}}</td>
{% if obj %}
<td>
{% if obj.confirmed %}
yes
{% else %}
no (<a href="/auth/send_verification_link?a={{h.urlquoteplus(a)}}">verify</a>)
{% endif %}
</td>
{% else %}
<td>Unknown addr obj {{a}}</td>
{% endif %}
<td>
<div class="addr-delete">
{{lib.submit_button('Delete', 'addr-%s.delete' % loop.index0)}}
{{lib.hidden_field('addr-%s.delete' % loop.index0, '')}}
</div>
</td>
</tr>
{% endfor %}
<tr>
<td colspan="2">{{lib.text_field('new_addr.addr', label='', type='email')}}</td>
<td colspan="2">{{lib.submit_button('Claim New Address', name='new_addr.claim')}}</td>
<script>
{# hitting Enter by default submits the first submit button which is Delete. Override that #}
$('input[name="new_addr.addr"]').on('keypress', function(e) {
if (e.key === 'Enter') {
e.preventDefault();
e.stopPropagation();
$('input[name="new_addr.claim"]').click();
}
});
</script>
</tr>
</table>
<div class="grid-22">
{{lib.submit_button('Save', name='addr-save')}}
</div>
{{lib.csrf_token()}}