Commit 639c5d2e authored by Mat's avatar Mat
Browse files

adaptation des templates de base (#twig, #bootstrap)

parent a9706a49
File mode changed from 100644 to 100755
<a href="http://mathieu.actic.be">Tchama</a> 2018 —
propulsé par
<a href="https://symfony.com/doc/current/index.html" target="_blank">Symfony 3</a>
habillé avec
<a href="https://twig.symfony.com/doc/2.x/" target="_blank">Twig</a>
propulsé par <a href="https://symfony.com/doc/current/index.html" target="_blank">Symfony 3</a>
{% extends '@Potage/layout.html.twig' %}
{% block title %}
Hello Potage!
Bienvenue sur Potage!
{% endblock %}
{% block body %}
......
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Potage</a>
<a class="navbar-brand" href="{{ path('potage_homepage') }}">Potage</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
......@@ -14,37 +15,72 @@
<a class="nav-link" href="{{ path('potage_homepage') }}">Accueil
<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item {{ app.request.get('_route') == 'potage_legume_read' ? 'active' }}">
<a class="nav-link" href="{{ path('potage_legume_read', {'page': 1}) }}">Les légumes
<span class="sr-only">(current)</span></a>
</li>
{#
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
#}
</ul>
<div id="login">
<ul class="navbar-nav mr-auto">
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{% if is_granted('ROLE_ADMIN') %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Administration
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="{{ path('potage_legume_read', {'page': 1}) }}">
Les légumes
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item disabled" href="#">Les offres</a>
<a class="dropdown-item disabled" href="#">Les infoslettres</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item disabled" href="#">Les commandes</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item disabled" href="#">Les utilisateurs</a>
<a class="dropdown-item disabled" href="#">Les groupes</a>
</div>
</li>
{% endif %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ app.user.username }}
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
<a href="{{ path('fos_user_profile_show') }}" class="dropdown-item">
Mon profil
</a>
<div class="dropdown-divider"></div>
<a href="{{ path('fos_user_security_logout') }}" class="dropdown-item">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
</div>
</li>
{% else %}
<li class="nav-item">
<a href="{{ path('fos_user_security_login') }}" class="nav-link">
{{ 'layout.login'|trans({}, 'FOSUserBundle') }}
</a>
</li>
<li class="nav-item">
<a href="{{ path('fos_user_registration_register') }}" class="nav-link">
{{ 'layout.register'|trans({}, 'FOSUserBundle') }}
</a>
</li>
{% endif %}
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Rechercher" aria-label="Search">
{#
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Go !</button>
#}
</form>
</ul>
</div>
</div>
</nav>
......@@ -82,3 +82,7 @@
</ul>
</nav>
{% endblock %}
{% block customJS %}
<script src="{{ asset('js/script.js') }}"></script>
{% endblock %}
......@@ -8,21 +8,17 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
{% endblock %}
{% block bodyParam %}{{ app.request.get('_route')|replace({'potage_': ''}) }}
{% endblock %}
{% block bodyParam %}{{ app.request.get('_route')|replace({'potage_': ''}) }}{% endblock %}
{% block layout %}
<header id="header">
<header id="header">
{% block header %}
{% include '@Potage/Default/navbar.html.twig' %}
{% endblock %}
<div class="container"></div>
</header>
<div id="content">
<div id="content">
{% block body %}
<aside>
{% block sidebar %}{% endblock %}
......@@ -43,33 +39,39 @@
<h1>{{ block('title') }}</h1>
{% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
<div class="flash-{{ type }}">
{{ message }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div>
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
{% endblock %}
</section>
{% endblock %}
<br class="clearfix"/>
<div class="container"></div>
</div>
{% block hero %}{% endblock %}
<footer id="footer">
{% block footer %}
{% include '@Potage/Default/footer.html.twig' %}
{% endblock %}
<div class="container"></div>
</footer>
{% block javascripts %}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="{{ asset('js/script.js') }}"></script>
{% endblock %}
{% endblock %}
{% block javascripts %}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
{% block customJS %}{% endblock %}
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment