| {#- |
| 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. |
| -#} |
| {% set hide_left_bar = True %} |
| {% extends "allura:templates/user_account_base.html" %} |
| |
| {% block title %}{{c.user.username}} / Preferences{% endblock %} |
| |
| {% block header %}User Preferences for {{c.user.username}}{% endblock %} |
| |
| {% block content %} |
| {{ super() }} |
| <div class="grid-23"> |
| <h2>Preferences</h2> |
| {% block info %} |
| <fieldset> |
| <legend>Username: {{ c.user.username }}</legend> |
| <p><a href="{{ c.user.private_project().url() }}">My profile and my projects</a></p> |
| <p><a href="{{ c.user.private_project().url() }}admin/overview">Set avatar icon</a></p> |
| {% if h.asbool(tg.config.get('auth.allow_user_to_disable_account', False)) %} |
| <p><a href="/auth/disable">Disable account</a></p> |
| {% endif %} |
| </fieldset> |
| {% endblock info %} |
| |
| {% block edit_prefs_form %} |
| {% if h.asbool(tg.config.get('auth.allow_edit_prefs', True)) %} |
| <form action="update" method="post"> |
| <fieldset> |
| <legend>General and Email Settings</legend> |
| <label class="grid-4">Display Name</label> |
| <div class="grid-18"> |
| <input name="preferences.display_name" value="{{c.user.display_name}}" type="text"> |
| </div> |
| <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> |
| |
| {% for a in c.user.email_addresses %} |
| <input name="addr-{{loop.index0}}.ord" value="{{loop.index0}}" type="hidden"/> |
| {% endfor %} |
| {# |
| # This is a hidden copy of a 'Save' submit button. |
| # We need this because form uses several submit buttons, and |
| # if user presses 'Enter' in one of the fields, browser chooses *first* submit button. |
| # In the case when user has at least one email address, first button is delete button |
| # for first email address. So user ends up deleting their first email address, |
| # instead of changing display name, for example. |
| #} |
| {{lib.submit_button('Save', style='display:none')}} |
| <hr> |
| <h3>Email Addresses</h3> |
| <table class="grid-22"> |
| <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' % loop.index0)}}</td> |
| </tr> |
| {% endfor %} |
| <tr> |
| <td colspan="2">{{lib.text_field('new_addr.addr', '')}}</td> |
| <td colspan="2">{{lib.submit_button('Claim New Address', name='new_addr.claim')}}</td> |
| </tr> |
| </table> |
| <div class="grid-22"> |
| <p></p> |
| {{lib.submit_button('Save')}} |
| </div> |
| {{lib.csrf_token()}} |
| </fieldset> |
| </form> |
| {% endif %} {# allow_edit_prefs #} |
| {% endblock edit_prefs_form %} |
| |
| |
| {% block password_change_form %} |
| {% if h.asbool(tg.config.get('auth.allow_password_change', True)) %} |
| <fieldset> |
| <legend>Change Password</legend> |
| {{ c.password_change_form.display() }} |
| </fieldset> |
| {% endif %} |
| {% endblock %} |
| |
| {% block upload_key_form %} |
| {% if h.asbool(tg.config.get('auth.allow_upload_ssh_key', False)) %} |
| <fieldset> |
| <legend>Upload ssh public key</legend> |
| {{ c.upload_key_form.display() }} |
| </fieldset> |
| {% endif %} |
| {% endblock %} |
| |
| {% block user_messages_form %} |
| {% if h.asbool(tg.config.get('auth.allow_user_messages_config', True)) %} |
| <fieldset> |
| <legend>User Messages</legend> |
| <form method="POST" action="user_message"> |
| <div class="grid-10"> |
| <input type="checkbox" id="allow_user_messages" name="allow_user_messages" {% if not c.user.get_pref('disable_user_messages') %} checked {% endif %}> |
| <label for="allow_user_messages">Allow another user to send me direct email messages</label> |
| </div> |
| <div class="grid-2"> |
| <input class="submit" type="submit" value="Save"> |
| </div> |
| {{ lib.csrf_token() }} |
| </form> |
| </fieldset> |
| {% endif %} |
| {% endblock %} |
| </div> |
| {% endblock %} |
| |
| {% block extra_css %} |
| {{ super() }} |
| <style> |
| fieldset { |
| margin-bottom: 2em; |
| border: 1px solid silver; |
| padding: 8px; |
| -webkit-border-radius: 4px; |
| -moz-border-radius: 4px; |
| border-radius: 4px; |
| } |
| legend { |
| margin: .2em; |
| padding: .2em; |
| font-size: 1.5em; |
| } |
| .pad hr { |
| margin: 15px 10px; |
| width: 860px; |
| padding: 0; |
| border: 0; |
| } |
| </style> |
| {% endblock %} |