From 377b390c97afb9106fd9a139819d00306f996f24 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 28 Nov 2019 02:08:18 +0100 Subject: [PATCH] Twig: Macros: Form: Use input options and primary submit button --- resources/views/macros/form.twig | 22 +++++++++++-------- .../views/pages/password/reset-form.twig | 4 ++-- resources/views/pages/password/reset.twig | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/resources/views/macros/form.twig b/resources/views/macros/form.twig index 5d41b085..6e821a28 100644 --- a/resources/views/macros/form.twig +++ b/resources/views/macros/form.twig @@ -1,18 +1,22 @@ -{% macro input(name, label, type, required) %} +{% macro input(name, label, type, opt) %}
- {% if label %} + {% if label -%} - {% endif %} -
-{% endmacro %} +{%- endmacro %} {% macro hidden(name, value) %} -{% endmacro %} +{%- endmacro %} {% macro submit(label) %} - -{% endmacro %} + +{%- endmacro %} diff --git a/resources/views/pages/password/reset-form.twig b/resources/views/pages/password/reset-form.twig index 60eb2499..a72dc92b 100644 --- a/resources/views/pages/password/reset-form.twig +++ b/resources/views/pages/password/reset-form.twig @@ -7,8 +7,8 @@
{{ csrf() }} - {{ f.input('password', __('Password'), 'password', true) }} - {{ f.input('password_confirmation', __('Confirm password'), 'password', true) }} + {{ f.input('password', __('Password'), 'password', {'required': true}) }} + {{ f.input('password_confirmation', __('Confirm password'), 'password', {'required': true}) }}
{{ f.submit(__('Save')) }} diff --git a/resources/views/pages/password/reset.twig b/resources/views/pages/password/reset.twig index 289152ea..b1de4eae 100644 --- a/resources/views/pages/password/reset.twig +++ b/resources/views/pages/password/reset.twig @@ -19,7 +19,7 @@ {{ csrf() }} {{ __('We will send you an e-mail with a password recovery link. Please use the email address you used for registration.') }} - {{ f.input('email', __('E-Mail'), 'email', true) }} + {{ f.input('email', __('E-Mail'), 'email', {'required': true}) }}
{{ f.submit(__('Recover')) }}