-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from qld-gov-au/QOLSVC-4096-email-template
[QOLSVC-4096] update user edit template to fix email notifications field
- Loading branch information
Showing
1 changed file
with
6 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,19 @@ | ||
{% ckan_extends %} | ||
{% import 'macros/form.html' as form %} | ||
|
||
<form id="user-edit-form" class="dataset-form" method="post" action="{{ action }}"> | ||
{{ form.errors(error_summary) }} | ||
|
||
{% block core_fields %} | ||
<fieldset> | ||
<legend>{{ _('Change details') }}</legend> | ||
{% if g.userobj.sysadmin == True %} | ||
{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium'], is_required=true, attrs={'class': 'form-control'}) }} | ||
{% if g.userobj.sysadmin %} | ||
{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium'], is_required=true, attrs={'class': 'form-control'}) }} | ||
{% else %} | ||
{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium'], attrs={'readonly': '', 'class': 'form-control'}) }} | ||
{{ form.input('name', label=_('Username'), id='field-username', value=data.name, error=errors.name, classes=['control-medium'], attrs={'readonly': '', 'class': 'form-control'}) }} | ||
{% endif %} | ||
|
||
{{ form.input('fullname', label=_('Full name'), id='field-fullname', value=data.fullname, error=errors.fullname, placeholder=_('eg. Joe Bloggs'), classes=['control-medium'], is_required=true) }} | ||
|
||
{{ form.input('email', label=_('Email'), id='field-email', type='email', value=data.email, error=errors.email, placeholder=_('eg. [email protected]'), classes=['control-medium'], is_required=true) }} | ||
|
||
{{ form.markdown('about', label=_('About'), id='field-about', value=data.about, error=errors.about, placeholder=_('A little information about yourself')) }} | ||
|
||
{% if show_email_notifications %} | ||
{% call form.checkbox('activity_streams_email_notifications', label=_('Subscribe to notification emails'), id='field-activity-streams-email-notifications', value=True, checked=g.userobj.activity_streams_email_notifications) %} | ||
{% set helper_text = _("You will receive notification emails from {site_title}, e.g. when you have new activities on your dashboard."|string) %} | ||
{{ form.info(helper_text.format(site_title=g.site_title), classes=['info-help-tight']) }} | ||
{% endcall %} | ||
{% endif %} | ||
|
||
</fieldset> | ||
|
||
<fieldset> | ||
<legend>{{ _('Change password') }}</legend> | ||
{{ form.input('old_password', | ||
type='password', | ||
label=_('Sysadmin Password') if is_sysadmin else _('Old Password'), | ||
id='field-password-old', | ||
value=data.oldpassword, | ||
error=errors.oldpassword, | ||
classes=['control-medium'], | ||
attrs={'autocomplete': 'off', 'class': 'form-control'} | ||
) }} | ||
|
||
{{ form.input('password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off', 'class': 'form-control'} ) }} | ||
|
||
{{ form.input('password2', type='password', label=_('Confirm Password'), id='field-password-confirm', value=data.password2, error=errors.password2, classes=['control-medium'], attrs={'autocomplete': 'off', 'class': 'form-control'}) }} | ||
</fieldset> | ||
|
||
<div class="form-actions"> | ||
{% block delete_button %} | ||
{% if h.check_access('user_delete', {'id': data.id}) %} | ||
<a class="btn btn-danger pull-left" href="{% url_for 'user_delete', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to delete this User?') }}">{% block delete_button_text %}{{ _('Delete') }}{% endblock %}</a> | ||
{% endif %} | ||
{% endblock %} | ||
{% block generate_button %} | ||
{% if h.is_apikey_enabled() %} | ||
{% if h.check_access('user_generate_apikey', {'id': data.id}) %} | ||
<a class="btn btn-warning" href="{% url_for 'user.generate_apikey', id=data.id %}" data-module="confirm-action" data-module-content="{{ _('Are you sure you want to regenerate the API key?') }}">{% block generate_button_text %}{{ _('Regenerate API Key') }}{% endblock %}</a> | ||
{% endif %} | ||
{% endif %} | ||
{% endblock %} | ||
{{ form.required_message() }} | ||
<button class="btn btn-primary" type="submit" name="save">{{ _('Update Profile') }}</button> | ||
</div> | ||
</form> | ||
{% endblock %} |