Auth\Form: add include_navbar parameter

This commit is contained in:
Benjamin Renard 2023-03-07 18:12:58 +01:00
parent 3bf65aea4d
commit fe75984bc7
4 changed files with 14 additions and 1 deletions

View file

@ -159,6 +159,9 @@ auth:
# Login form
#
login_form:
# Include application navbar (default: true)
include_navbar: true
# Display link for other authentication methods
# Note: method as key and label as value
display_other_methods:

View file

@ -159,6 +159,9 @@ auth:
# Login form
#
login_form:
# Include application navbar (default: true)
include_navbar: true
# Display link for other authentication methods
# Note: method as key and label as value
display_other_methods:

View file

@ -21,6 +21,7 @@ class Form extends Method {
'auth.login_form',
array(
'display_other_methods' => array(),
'include_navbar' => true,
)
);
Url :: add_url_handler('#^login$#', array('EesyPHP\\Auth\\Form', 'handle_login'), null, false);
@ -69,6 +70,7 @@ class Form extends Method {
else
Tpl :: assign('next', (isset($_REQUEST['next'])?urldecode($_REQUEST['next']):''));
Tpl :: assign('display_other_methods', $display_other_methods);
Tpl :: assign('include_navbar', App::get('auth.login_form.include_navbar', null, 'bool'));
Tpl :: display('login.tpl', I18n::_('Sign in'));
}

View file

@ -1,9 +1,14 @@
{extends file='Tpl:empty.tpl'}
{if !$include_navbar}
{block name="navbar"}{/block}
{/if}
{block name="pagetitle"}{/block}
{block name="content"}
{block name="main"}
<main class="form-signin w-100 m-auto text-center">
<form action="login" method="POST">
{if !$include_navbar}
<img class="mb-4" src="{static_url path="images/logo.svg"}" alt="" width="100">
{/if}
<h1 class="h3 mb-3 fw-normal">{t domain=$CORE_TEXT_DOMAIN}Sign in{/t}</h1>
{include file='Tpl:errors.tpl'}