Parent: [ad2d70] (diff)

Child: [8feb54] (diff)

Download this file

user_preferences.html    280 lines (258 with data), 10.2 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
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{% set hide_left_bar = True %}
{% extends g.theme.master %}
{% block title %}{{c.user.username}} / Preferences{% endblock %}
{% block header %}User Preferences for {{c.user.username}}{% endblock %}
{% block content %}
<ul id="account-nav-menu" class="b-hornav droppy">
{% for item in menu -%}
<li id="{{ item.tabid }}">
<a href="{{ item.target }}">
{{ item.title }}
<div class="marker{% if item.target.rstrip('/') == request.path.rstrip('/') %} current{% endif %}"></div>
</a>
</li>
{%- endfor %}
</ul>
<div style="clear:both" class="grid-20">
<h2>Personal Settings</h2>
{{g.theme.personal_data_form.display(action="/auth/prefs/change_personal_data", user=c.user)}}
</div>
<div style="clear:both" class="grid-20">
<a name="Contacts"></a>
<h2>Personal Contacts</h2>
<h3>Skype account</h3>
{{g.theme.skype_account_form.display(action="/auth/prefs/skype_account",
initial_value=c.user.get_pref('skypeaccount'))}}
{%if c.user.get_pref('socialnetworks') or c.user.get_pref('telnumbers') or c.user.get_pref('webpages') %}
<h3>Other existing contacts</h3>
<table>
<tr>
<thead>
<th>Type</th>
<th>Contact</th>
<th>Actions</th>
</thead>
</tr>
{% for sn in c.user.get_pref('socialnetworks') %}
{{g.theme.remove_socialnetwork_form.display(account=sn.accounturl, socialnetwork=sn.socialnetwork)}}
{% endfor %}
{% for tn in c.user.get_pref('telnumbers') %}
{{g.theme.remove_textvalue_form.display(action="/auth/prefs/remove_telnumber", value=tn, label="Telephone number")}}
{%endfor%}
{% for ws in c.user.get_pref('webpages') %}
{{g.theme.remove_textvalue_form.display(action="/auth/prefs/remove_webpage", value=ws, label="Website url")}}
{%endfor%}
</table>
{% endif %}
<h3>Add a social network account</h3>
{{g.theme.add_socialnetwork_form.display(action="/auth/prefs/add_social_network")}}
<h3>Add a telephone number</h3>
{{g.theme.add_telnumber_form.display(action="/auth/prefs/add_telnumber")}}
<h3>Add a personal website</h3>
{{g.theme.add_website_form.display(action="/auth/prefs/add_webpage")}}
</div>
<a name="Availability"></a>
<div style="clear:both" class="grid-20">
<h2>Availability</h2>
<div class="grid-18">
If you want, you can set the weekly timeslot during which you are usually available to support other users of the forge.
Please, set your time intervals choosing a weekday and entering the time interval according to the timezone specified in your
personal data, using the format HH:MM. If you didn't set any timezone, your timeslots could be meaningless to other users,
therefore they will be ignored.
</div>
<div class="grid-18">
You can also specify periods of time during which you won't be able to work on the forge, in orther to communicate other users
that they can't contact you during those days. Please, do it specifying date intervals in format DD/MM/YYYY.
</div>
</div>
<div class="grid-20">
{%if c.user.get_availability_timeslots() %}
<h3>Existing availability timeslots</h3>
<table>
<tr>
<thead>
<th>Weekday</th>
<th>Start time</th>
<th>End time</th>
<th>Actions</th>
</thead>
</tr>
{% for ts in c.user.get_availability_timeslots() %}
{{g.theme.remove_timeslot_form.display(
action="/auth/prefs/remove_timeslot",
weekday=ts.week_day,
starttime=ts.start_time,
endtime=ts.end_time)}}
{%endfor%}
</table>
{% endif %}
<h3>Add a new availability timeslot</h3>
{{g.theme.add_timeslot_form.display(action="/auth/prefs/add_timeslot")}}
</div>
<div class="grid-20">
{%if c.user.get_inactive_periods() %}
<h3>Existing periods of inactivity on the forge</h3>
<table>
<tr>
<thead>
<th>Start date</th>
<th>End date</th>
<th>Actions</th>
</thead>
</tr>
{% for ip in c.user.get_inactive_periods() %}
{{g.theme.remove_inactive_period_form.display(
action="/auth/prefs/remove_inactive_period",
startdate=ip.start_date,
enddate=ip.end_date)}}
{%endfor%}
</table>
{% endif %}
<h3>Add a new period of inactivity on the forge</h3>
{{g.theme.add_inactive_period_form.display(action="/auth/prefs/add_inactive_period")}}
</div>
<div class="grid-20">
<h2>Skills list</h2>
<ul><li><a href="/auth/prefs/user_skills">Click here to check and change your skills list</a></li></ul>
</div>
{% if g.theme.password_change_form %}
<div class="grid-20">
<h2>Change Password</h2>
{{ g.theme.password_change_form.display() }}
</div>
{% endif %}
{% if g.theme.upload_key_form %}
<div class="grid-20">
<h2>Upload ssh public key</h2>
{{ g.theme.upload_key_form.display() }}
</div>
{% endif %}
{% if tg.config.get('auth.method', 'local') == 'local' %}
<br style="clear:both"/>
<h2>API Token</h2>
{% if api_token %}
<p>
<b>API Key:</b><br/>
{{api_token.api_key}}<br/>
<b>Secret Key:</b><br/>
{{api_token.secret_key}}<br/>
</p>
<form method="POST" action="del_api_token" class="grid-18">
<input type="submit" value="Delete API Token">
</form>
{% else %}
<p>No API token generated</p>
{% endif %}
<form method="POST" action="gen_api_token" class="grid-18">
<input type="submit" value="(Re)generate API Token">
</form>
{% endif %}
<div style="clear:both"></div>
<h2>Authorized Third-party Applications</h2>
{% for access_tok in authorized_applications %}
<div>
<h3>{{access_tok.consumer_token.name}}</h3>
{{access_tok.consumer_token.description_html}}
{{ c.revoke_access.display(value=access_tok) }}
<br style="clear:both"/>
</div>
{% endfor %}
{% if not authorized_applications %}<p>No authorized third-party applications</p>{% endif %}
<h2>Subscriptions</h2>
{% if subscriptions %}
<p><em>Mark tools that you want to subscribe to. Unmark tools that you want to unsubscribe from. Press 'Save' button.</em></p>
{{c.form.display(action='update_subscriptions', value=dict(subscriptions=subscriptions))}}
{% else%}
<p>No subscriptions.</p>
{% endif %}
<hr/>
<div style="clear:both">&nbsp;</div>
<form action="update" method="post">
{% if tg.config.get('auth.method', 'local') == 'local' %}
<label class="grid-4">Display Name</label>
<div class="grid-18">
<input name="preferences.display_name" value="{{c.user.display_name}}" type="text">
</div>
{% endif %}
<label class="grid-4">Email Format</label>
<div class="grid-18">
<select name="preferences.email_format">
<option value="plain" {{'selected' if c.user.preferences.email_format == 'plain' else ''}}>Plain Text</option>
<option value="html" {{'selected' if c.user.preferences.email_format == 'html' else ''}}>HTML</option>
<option value="both" {{'selected' if c.user.preferences.email_format == 'both' else ''}}>Combined</option>
</select>
</div>
{% if tg.config.get('auth.method', 'local') == 'local' %}
<label class="grid-4">Page Size</label>
<div class="grid-18">
<select name="preferences.results_per_page">
{% for per_page in [25, 50, 100, 250] %}
<option {% if per_page == c.user.preferences.results_per_page %}selected="selected"{% endif %}
value="{{per_page}}">{{per_page}}</option>
{% endfor %}
</select>
</div>
{% endif %}
{% if tg.config.get('auth.method', 'local') == 'local' %}
{% for a in c.user.email_addresses %}
<input name="addr-{{loop.index0}}.ord" value="{{loop.index0}}" type="hidden"/>
{% endfor %}
{% if c.user.email_addresses %}
<h3 class="grid-18">Email Addresses</h3>
<table class="grid-18">
<tr>
<th>Primary?</th>
<th>Address</th>
<th>Confirmed</th>
<th></th>
</tr>
{% for a in c.user.email_addresses %}
<tr>
{% set obj = c.user.address_object(a) %}
<td>{{lib.radio_button('primary_addr', None, a, c.user.preferences.email_address)}}</td>
<td>{{a}}</td>
{% if obj %}
<td>
{% if obj.confirmed %}
yes
{% else %}
no (<a href="{{g.url('/auth/send_verification_link', a=a)}}">verify</a>)
{% endif %}
</td>
{% else %}
<td>Unknown addr obj {{a}}</td>
{% endif %}
<td>{{lib.submit_button('Delete', 'addr-%s.delete' % i)}}</td>
</tr>
{% endfor %}
</table>
{% endif %}
<div class="grid-18">
{{lib.text_field('new_addr.addr', 'New Email Address')}}
{{lib.submit_button('Claim Address', name='new_addr.claim')}}
</div>
{% if c.user.open_ids %}
<h3 class="grid-18">OpenIDs Claimed</h3>
<table class="grid-18">
<tr>
<th>OpenID</th>
<th></th>
</tr>
{% for oid in c.user.open_ids %}
{% set obj = c.user.openid_object(oid) %}
<tr>
<td>{{oid}}</td>
<td>{{lib.submit_button('Delete', 'oid-%s.delete' % loop.index0)}}</td>
</tr>
{% endfor %}
</table>
{% endif %}
<div class="grid-18">
<a href="/auth/claim_oid">Claim New OpenID</a>
</div>
{% endif %}
<div class="grid-18">
{{lib.submit_button('Save Changes')}}
</div>
</form>
{% endblock %}