Layout : separate file header/footer

master
Julien Rosset 5 years ago
parent fc96e0edff
commit 988cbba2d2

@ -1,11 +1,11 @@
#messages {
display: none;
}
button.ui-dialog-titlebar-close {
&:focus {
outline: none;
}
&::-moz-focus-inner {
border: 0;
}
}
//#messages {
// display: none;
//}
//button.ui-dialog-titlebar-close {
// &:focus {
// outline: none;
// }
// &::-moz-focus-inner {
// border: 0;
// }
//}

@ -1,10 +1,10 @@
const $ = require('jquery');
require('jquery-ui-css/all.css');
require('jquery-ui/dialog');
$(function () {
/* Messages */
$('#messages div').each(function () {
$(this).dialog();
});
});
//const $ = require('jquery');
//require('jquery-ui-css/all.css');
//require('jquery-ui/dialog');
//
//$(function () {
// /* Messages */
// $('#messages div').each(function () {
// $(this).dialog();
// });
//});

@ -8,7 +8,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Controller about security (login / logout)
@ -19,23 +18,17 @@ class SecurityController extends AbstractController {
/**
* Show login form
*
* @param TranslatorInterface $translator Interface for translation
* @param AuthenticationUtils $authenticationUtils Helper for authentication information
*
* @return Response Page response
*
* @Route("/sign-in")
*/
public function sign_in (TranslatorInterface $translator, AuthenticationUtils $authenticationUtils): Response {
public function sign_in (AuthenticationUtils $authenticationUtils): Response {
$form = $this->createForm(
SecuritySignInForm::class,
[
'email' => $authenticationUtils->getLastUsername(),
],
[
// 'attr' => [
// 'novalidate' => 'novalidate',
// ],
]
);
@ -58,4 +51,12 @@ class SecurityController extends AbstractController {
public function sign_out () {
throw new Exception('This method can be blank - it will be intercepted by the logout key on your firewall');
}
/**
* Show inscription form
*
* @Route("/sign-up")
*/
public function sign_up () {
}
}

@ -0,0 +1 @@
<footer></footer>

@ -0,0 +1,19 @@
<header>
<div id="logo">
Giftopic
</div>
<nav>
<a href="{{ path('app_site_index') }}" class="fas fa-home"></a>
{% if app.user %}
<div class="dropdown">
<button type="button" id="menu_username" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ app.user.username }}</button>
<div class="dropdown-menu" aria-labelledby="menu_username">
<a href="{{ path('app_security_sign_out') }}" class="dropdown-item">{{ 'sign.out'|trans({}, 'security') }}</a>
</div>
</div>
{% else %}
{# <li><a href="{{ path('app_security_sign_up') }}">{% trans from 'security' %}sign.up{% endtrans %}</a></li>#}
<a href="{{ path('app_security_sign_in') }}">{{ 'sign.in'|trans({}, 'security') }}</a>
{% endif %}
</nav>
</header>

@ -12,41 +12,21 @@
{% endblock %}
</head>
<body>
<header>
<div id="logo">
Giftopic
</div>
<nav>
<a href="{{ path('app_site_index') }}" class="fas fa-home"></a>
{% if app.user %}
<div class="dropdown">
<button type="button" id="menu_username" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ app.user.username }}</button>
<div class="dropdown-menu" aria-labelledby="menu_username">
<a href="{{ path('app_security_sign_out') }}" class="dropdown-item">{{ 'sign.out'|trans({}, 'security') }}</a>
</div>
</div>
{% else %}
{# <li><a href="{{ path('app_security_sign_up') }}">{% trans from 'security' %}sign.up{% endtrans %}</a></li>#}
<a href="{{ path('app_security_sign_in') }}">{{ 'sign.in'|trans({}, 'security') }}</a>
{% endif %}
</nav>
</header>
{% include '_header.html.twig' %}
{% block body %}{% endblock %}
{% include '_footer.html.twig' %}
<footer></footer>
<div id="messages">
{% for type, messages in app.flashes(['error', 'warning']) %}
{% if messages %}
<div id="flash-{{ type }}" title="{{ type|trans({}, 'messages') }}">
{% for message in messages %}
<p>{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endfor %}
</div>
{# <div id="messages">#}
{# {% for type, messages in app.flashes(['error', 'warning']) %}#}
{# {% if messages %}#}
{# <div id="flash-{{ type }}" title="{{ type|trans({}, 'messages') }}">#}
{# {% for message in messages %}#}
{# <p>{{ message }}</p>#}
{# {% endfor %}#}
{# </div>#}
{# {% endif %}#}
{# {% endfor %}#}
{# </div>#}
<!-- JAVASCRIPT -->
{% block javascripts %}

Loading…
Cancel
Save