login-twofa.html.twig 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. {% set layout = layout ?? form.layout ?? 'default' %}
  2. {% set field_layout = layout %}
  3. {% set form = forms('login-twofa') %}
  4. {% set client_side_validation = form.client_side_validation is not null ? form.client_side_validation : config.plugins.form.client_side_validation|default(true) %}
  5. {% set inline_errors = form.inline_errors is not null ? form.inline_errors : config.plugins.form.inline_errors(false) %}
  6. <form method="post" action="{{ (base_url_relative ~ uri.path)|e }}" class="{{ form_outer_classes }} twofa-form">
  7. {% for field in form.fields %}
  8. {% set field = prepare_form_field(field, field_name) %}
  9. {% if field %}
  10. {% set value = field.name == 'username' ? username : '' %}
  11. {# {% set value = form.value(field.name) %} #}
  12. {% set field_templates = include_form_field(field.type, field_layout) %}
  13. {% block field %}
  14. {% include field_templates ignore missing %}
  15. {% endblock %}
  16. {% endif %}
  17. {% endfor %}
  18. {{ nonce_field('login-form', 'login-form-nonce')|raw }}
  19. <div class="{{ form_button_outer_classes ?: 'form-actions secondary-accent' }}">
  20. <div class="form-actions primary-accent">
  21. <button type="submit" class="{{ form_button_classes ?: 'button primary' }}" name="task" value="login.twofa"><i class="fa fa-sign-in"></i> {{ 'PLUGIN_LOGIN.BTN_LOGIN'|t }}</button>
  22. <button type="submit" class="{{ form_button_classes ?: 'button secondary' }}" name="task" value="login.logout">{{ 'PLUGIN_LOGIN.BTN_CANCEL'|t }}</button>
  23. </div>
  24. </div>
  25. </form>