Layout : separate file header/footer

master
Julien Rosset 5 years ago
parent fc96e0edff
commit 988cbba2d2

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

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

@ -8,7 +8,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Contracts\Translation\TranslatorInterface;
/** /**
* Controller about security (login / logout) * Controller about security (login / logout)
@ -19,23 +18,17 @@ class SecurityController extends AbstractController {
/** /**
* Show login form * Show login form
* *
* @param TranslatorInterface $translator Interface for translation
* @param AuthenticationUtils $authenticationUtils Helper for authentication information * @param AuthenticationUtils $authenticationUtils Helper for authentication information
* *
* @return Response Page response * @return Response Page response
* *
* @Route("/sign-in") * @Route("/sign-in")
*/ */
public function sign_in (TranslatorInterface $translator, AuthenticationUtils $authenticationUtils): Response { public function sign_in (AuthenticationUtils $authenticationUtils): Response {
$form = $this->createForm( $form = $this->createForm(
SecuritySignInForm::class, SecuritySignInForm::class,
[ [
'email' => $authenticationUtils->getLastUsername(), 'email' => $authenticationUtils->getLastUsername(),
],
[
// 'attr' => [
// 'novalidate' => 'novalidate',
// ],
] ]
); );
@ -58,4 +51,12 @@ class SecurityController extends AbstractController {
public function sign_out () { public function sign_out () {
throw new Exception('This method can be blank - it will be intercepted by the logout key on your firewall'); 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 %} {% endblock %}
</head> </head>
<body> <body>
<header> {% include '_header.html.twig' %}
<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>
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% include '_footer.html.twig' %}
<footer></footer> {# <div id="messages">#}
{# {% for type, messages in app.flashes(['error', 'warning']) %}#}
<div id="messages"> {# {% if messages %}#}
{% for type, messages in app.flashes(['error', 'warning']) %} {# <div id="flash-{{ type }}" title="{{ type|trans({}, 'messages') }}">#}
{% if messages %} {# {% for message in messages %}#}
<div id="flash-{{ type }}" title="{{ type|trans({}, 'messages') }}"> {# <p>{{ message }}</p>#}
{% for message in messages %} {# {% endfor %}#}
<p>{{ message }}</p> {# </div>#}
{% endfor %} {# {% endif %}#}
</div> {# {% endfor %}#}
{% endif %} {# </div>#}
{% endfor %}
</div>
<!-- JAVASCRIPT --> <!-- JAVASCRIPT -->
{% block javascripts %} {% block javascripts %}

Loading…
Cancel
Save