Skip to content

Commit

Permalink
Change implementation to use wrapper blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 14, 2025
1 parent 2ed6666 commit 026fbdf
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions templates/page/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,35 @@
</div>
{% endif %}

{% block login_top %}{% endblock %}

{% block login_form_wrapper %}
<form method="post" action="{{ action|default('') }}">
{% if csrf_token_intention|default(false) %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token(csrf_token_intention) }}">
{% endif %}

<input type="hidden" name="{{ target_path_parameter|default('_target_path') }}" value="{{ target_path|default(ea.hasContext ? path(ea.dashboardRouteName) : '/') }}" />

{% block login_form_top %}{% endblock %}

<div class="form-group">
<label class="form-control-label required" for="username">{{ _username_label }}</label>
<div class="form-widget">
<input type="text" id="username" name="{{ username_parameter|default('_username') }}" class="form-control" value="{{ last_username|default('') }}" required autofocus autocomplete="username">
</div>
</div>

<div class="form-group">
<label class="form-control-label required" for="password">{{ _password_label }}</label>
<div class="form-widget">
<input type="password" id="password" name="{{ password_parameter|default('_password') }}" class="form-control" required autocomplete="current-password">
{% block login_form_credentials_wrapper %}
<div class="form-group">
<label class="form-control-label required" for="username">{{ _username_label }}</label>
<div class="form-widget">
<input type="text" id="username" name="{{ username_parameter|default('_username') }}" class="form-control" value="{{ last_username|default('') }}" required autofocus autocomplete="username">
</div>
</div>

{% if forgot_password_enabled|default(false) %}
<div class="form-text">
<a href="{{ forgot_password_path|default('#') }}">{{ _forgot_password_label }}</a>
<div class="form-group">
<label class="form-control-label required" for="password">{{ _password_label }}</label>
<div class="form-widget">
<input type="password" id="password" name="{{ password_parameter|default('_password') }}" class="form-control" required autocomplete="current-password">
</div>
{% endif %}
</div>

{% block login_form_bottom %}{% endblock %}
{% if forgot_password_enabled|default(false) %}
<div class="form-text">
<a href="{{ forgot_password_path|default('#') }}">{{ _forgot_password_label }}</a>
</div>
{% endif %}
</div>
{% endblock login_form_credentials_wrapper %}

{% if remember_me_enabled|default(false) %}
<div class="form-group">
Expand All @@ -95,8 +92,7 @@
</form>

<script src="{{ asset('login.js', constant('EasyCorp\\Bundle\\EasyAdminBundle\\Asset\\AssetPackage::PACKAGE_NAME')) }}"></script>

{% block login_bottom %}{% endblock %}
{% endblock login_form_wrapper %}
</section>
</div>
{% endblock %}

0 comments on commit 026fbdf

Please sign in to comment.