reset-form.html.twig 1.4 KB

123456789101112131415161718192021222324252627282930
  1. {% if uri.param('token') and uri.param('task') %}
  2. {% set layout = layout ?? form.layout ?? 'default' %}
  3. {% set field_layout = layout %}
  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. <section id="grav-login">
  7. {{ content|raw }}
  8. <form method="post" action="{{ (base_url_relative ~ uri.path)|e }}" classes="{{ form_outer_classes }}">
  9. {% for field in form.fields %}
  10. {% set field = prepare_form_field(field, field_name) %}
  11. {% if field %}
  12. {% set value = attribute(grav.twig.twig_vars, field.name) is defined ? attribute(grav.twig.twig_vars, field.name) : null %}
  13. {% set field_templates = include_form_field(field.type, field_layout) %}
  14. {% block field %}
  15. {% include field_templates ignore missing %}
  16. {% endblock %}
  17. {% endif %}
  18. {% endfor %}
  19. <div class="form-actions secondary-accent">
  20. <button type="submit" class="button primary" name="task" value="login.reset"><i class="fa fa-key"></i> {{ "PLUGIN_LOGIN.BTN_RESET_PASSWORD"|t }}</button>
  21. </div>
  22. {{ nonce_field('reset-form', 'reset-form-nonce')|raw }}
  23. </form>
  24. </section>
  25. {% endif %}