Files
core/templates/users/edit.html.twig
T

103 lines
3.7 KiB
Twig

{% extends '@bolt/_base/layout.html.twig' %}
{% import '@bolt/_macro/_macro.html.twig' as macro %}
{% block title %}
{{ macro.icon('user') }}
{{ 'title.edit_user'|trans }} » {{ display_name|default(__('user.new_user')) }}
{% endblock %}
{% block vue_id 'editor' %}
{% block main %}
<div>
<form method="post" id="editcontent" >
<input type="hidden" name="_csrf_token" value="{{ csrf_token('useredit') }}">
{% include '@bolt/_partials/fields/text.html.twig' with {
'label' : 'label.username'|trans,
'name' : 'username',
'value' : user.username,
'disabled' : user.username is empty ? 'false' : 'true',
} %}
{% include '@bolt/_partials/fields/text.html.twig' with {
'label' : 'label.display_name'|trans,
'name' : 'displayName',
'value' : user.displayName,
'disabled' : false,
} %}
{% include '@bolt/_partials/fields/password.html.twig' with {
'label': 'label.password'|trans,
'name': 'password',
'value': suggestedPassword,
'hidden': 'false',
} %}
{% include '@bolt/_partials/fields/email.html.twig' with {
'label': 'label.email'|trans,
'label_class': 'required',
'value': user.email,
'name': 'email',
'class': 'form-control',
} %}
{% set localeOptions = [] %}
{% for locale in locales() %}
{% set localeOptions = localeOptions|merge([
{
'key': locale.code,
'value': locale.name ~ ' (' ~ locale.localizedname ~ ', ' ~ locale.code ~ ')'
}
]) %}
{% endfor %}
{% include '@bolt/_partials/fields/select.html.twig' with {
'label' : 'label.locale'|trans,
'name' : 'locale',
'value' : user.locale,
'options' : localeOptions,
} %}
{% set roleOptions = [] %}
{% for roleName, roleHierarchy in roles %}
{% set roleOptions = roleOptions|merge([
{
'key': roleName,
'value': roleName ~ ' (' ~ roleHierarchy|join(', ')|lower ~ ')'
}
]) %}
{% endfor %}
{% include '@bolt/_partials/fields/select.html.twig' with {
'label' : 'label.roles'|trans,
'name' : 'roles',
'value' : user.roles,
'options' : roleOptions,
} %}
{# TODO: include form field with '@bolt/_partials/fields/select.html.twig' #}
{# Comment out for a while, until we work on this again
<div class="form-group">
<label for="backendTheme" class="required">Backend theme</label>
<select id="backendTheme" name="backendTheme" class="form-control">
<option value="default" selected="selected">The Default theme</option>
<option value="dark">The Default Dark theme</option>
<option value="light">A pretty Light theme</option>
<option value="woordpers">WoordPers: Kinda looks like that other CMS</option>
</select>
</div>
<theme-select></theme-select>
#}
<button type="submit" class="btn btn-primary">
<i class="fa fa-save" aria-hidden="true"></i> {{ 'action.save'|trans }}
</button>
</form>
</div>
{% endblock %}