Files
ave-cms/system/App/Frontend/Auth/view/profile.twig
T
2026-07-27 12:58:44 +03:00

19 lines
4.8 KiB
Twig

<div class="static_page system-public-auth">
<div class="page_title"><div class="page_title_inner"><h1 class="page_title_heading">{{ page.title }}</h1></div></div>
<div class="static_page_inner">
{% if page.description %}<p class="text-muted">{{ page.description }}</p>{% endif %}<p>{{ user.email ? user.email|e : user.phone|e }}</p>
{% if saved %}<div class="alert alert-success" role="status">Изменения сохранены.</div>{% endif %}{% if errors._form %}<div class="alert alert-danger" role="alert">{{ errors._form }}</div>{% endif %}
<form method="post" action="{{ base }}{{ auth_urls.profile }}" class="system-public-auth-form">
<input type="hidden" name="_csrf" value="{{ csrf|e }}">
<div class="form-row"><div class="form-group col-md-6"><label for="profile-firstname">Имя</label><input class="form-control" id="profile-firstname" name="firstname" value="{{ user.firstname|e }}" autocomplete="given-name" required>{% if errors.firstname %}<small class="text-danger">{{ errors.firstname }}</small>{% endif %}</div><div class="form-group col-md-6"><label for="profile-lastname">Фамилия</label><input class="form-control" id="profile-lastname" name="lastname" value="{{ user.lastname|e }}" autocomplete="family-name"></div></div>
<div class="form-row"><div class="form-group col-md-6"><label for="profile-phone">Телефон</label><input class="form-control" id="profile-phone" name="phone" value="{{ user.phone|e }}" autocomplete="tel"{{ not user.email and user.phone_verified_at ? ' readonly' : '' }}>{% if not user.email and user.phone_verified_at %}<small class="form-text text-muted">Для смены подтверждённого номера обратитесь к администратору.</small>{% endif %}</div><div class="form-group col-md-6"><label for="profile-company">Компания</label><input class="form-control" id="profile-company" name="company" value="{{ user.company|e }}" autocomplete="organization"></div></div>
<div class="form-row"><div class="form-group col-md-5"><label for="profile-city">Город</label><input class="form-control" id="profile-city" name="city" value="{{ user.city|e }}" autocomplete="address-level2"></div><div class="form-group col-md-4"><label for="profile-street">Улица</label><input class="form-control" id="profile-street" name="street" value="{{ user.street|e }}" autocomplete="street-address"></div><div class="form-group col-md-3"><label for="profile-street-nr">Дом / офис</label><input class="form-control" id="profile-street-nr" name="street_nr" value="{{ user.street_nr|e }}"></div></div>
<div class="form-group"><label for="profile-zipcode">Индекс</label><input class="form-control" id="profile-zipcode" name="zipcode" value="{{ user.zipcode|e }}" autocomplete="postal-code"></div>
{% if fields %}<h2 class="h4 system-public-auth-section-title">Дополнительные данные</h2>{% endif %}
<div class="form-row">{% for field in fields %}<div class="form-group col-md-6">{% if field.type == 'checkbox' %}<div class="form-check"><input class="form-check-input" id="profile-extra-{{ field.id }}" type="checkbox" name="extra[{{ field.id }}]" value="1" {{ extra_values[field.id] == '1' ? 'checked' : '' }} {{ field.is_required ? 'required' : '' }}><label class="form-check-label" for="profile-extra-{{ field.id }}">{{ field.name }}</label></div>{% else %}<label for="profile-extra-{{ field.id }}">{{ field.name }}</label>{% if field.type == 'textarea' %}<textarea class="form-control" id="profile-extra-{{ field.id }}" name="extra[{{ field.id }}]" rows="4" {{ field.is_required ? 'required' : '' }}>{{ extra_values[field.id]|default('')|e }}</textarea>{% elseif field.type == 'select' %}<select class="form-control" id="profile-extra-{{ field.id }}" name="extra[{{ field.id }}]" {{ field.is_required ? 'required' : '' }}><option value="">Не выбрано</option>{% for choice in field.choices %}<option value="{{ choice|e }}" {{ extra_values[field.id] == choice ? 'selected' : '' }}>{{ choice }}</option>{% endfor %}</select>{% else %}<input class="form-control" id="profile-extra-{{ field.id }}" type="{{ field.type in ['date','number','email','tel'] ? field.type : 'text' }}" name="extra[{{ field.id }}]" value="{{ extra_values[field.id]|default('')|e }}" {{ field.is_required ? 'required' : '' }}>{% endif %}{% endif %}{% if errors['extra_' ~ field.id] %}<small class="text-danger">{{ errors['extra_' ~ field.id] }}</small>{% endif %}</div>{% endfor %}</div>
<div class="system-public-auth-actions"><button class="btn btn-primary" type="submit">{{ page.submit_label }}</button>{% if user.email %}<a href="{{ base }}{{ auth_urls.password }}">Изменить пароль</a>{% endif %}</div>
</form>
{% include '@system_auth/oauth_connections.twig' %}
</div>
</div>