gmarche/views/layout.twig

160 lines
9.0 KiB
Twig

<!DOCTYPE html>
<html>
<head>
<title>{% block title "Ğ1-Marché " %}</title>
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/sandstone/bootstrap.min.css">
<link rel="shortcut icon" type="image/x-icon" href="\images\favicon.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kalam&display=swap">
<link rel="stylesheet" href="/css/mapael.css">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/products.css">
<style>
body {
padding-top: 5rem;
}
.page {
display: grid;
grid-template-rows:60px 50px 1fr 80px;
grid-template-columns: 1fr 1fr 1fr;
grid-template-areas:
"site site site"
"header header header"
"breadcrumbs breadcrumbs breadcrumbs"
"sidebar main main"
"footer footer footer";
}
.site {
grid-column: 2 / 3;
}
</style>
<script type="text/javascript" src="/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="/js/connex.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mapael/2.1.0/js/jquery.mapael.min.js" charset="utf-8"></script>
<script type="text/javascript" src="https://rawgit.com/neveldo/mapael-maps/master/france/france_regions_2016.js" charset="utf-8"></script>
</head>
<body class="fond page">
<div class="site">
<nav class="navbar fixed-top navbar-expand-sm navbar-dark bg-dark">
<a class="navbar-brand" href="#">Ğ1-Marché</a>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link {% if accueil %} active{% endif %}" style="font-size:14px;"
href="{{ path('gmarche.index') }}">Accueil</a>
</li>
{% if (affiche_role()==0 or affiche_role()==1 or affiche_role()==2) and (affiche_username() !=''
or (sess.connecte != '' and sess.connecte != '---')) %}
<li class="nav-item">
{% if affiche_username() !='' %}
<a class="nav-link {% if explodeUrl()[1]=='dashboard' %} active{% endif %}" style="font-size:14px;"
href="{{ path('dashboard',{user:affiche_username()}) }}">Administration</a>
{% else %}
{% if (sess.connecte != '' and sess.connecte != '---') %}
<a class="nav-link {% if explodeUrl()[1]=='dashboard' %} active{% endif %}" style="font-size:14px;"
href="{{ path('dashboard',{user:sess.connecte}) }}">Administration</a>
{% endif %}
{% endif %}
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link {% if explodeUrl()[1]=='contact' %} active{% endif %}" style="font-size:14px;"
href="{{ path('contact') }}">Qui sommes-nous ?
</a>
</li>
</ul>
<div class="navbar-nav">
<div class="navbar-text" style="color:lightgray;margin-right:15px; margin-top:3px;">
{{ "now"|date('d/m/y') }}
</div>
{% if affiche_username() != '' or (sess.connecte != '' and sess.connecte != '---') %}
<form method="post" style="margin-top:5px;" action="{{ path('account.profil',{user:affiche_username()}) }}">
<span><img src="\avatar_user.png" width="22" height="22" /></span>
<button id="nom_connecte_bis" style="color:white;font-size: 14px;" class="btn-primary">
{% if affiche_username() != '' %}
{{ affiche_username() }}
{% else %}
{{ sess.connecte }}
{% endif %}
</button>
<div style="width:0;height:0;">
{{ field('email', affiche_mail(), "", {type: 'hidden'}) }}
</div>
</form>
<form method="post" action="{{ path('auth.logout') }}">
<!-- csrf_input() }}-->
<button class="btn btn-danger" style="margin-left: 7px; font-size:14px;">Se déconnecter</button>
</form>
{% else %}
<form id="formulaire" method="post" style="margin-top:5px;" action="{{ path('account.profil',{user:''}) }}">
<div class="nav-item" id="avatar-user" style="display:none;padding-top:0.1rem;margin-right:0.4rem;">
</div>
<div class="nav-item" id="user-connecte" style="display:none;padding-top:0.1rem;">
<button id="contenu_bouton" style="color:white; font-size: 14px;" class="btn-primary">
</button>
</div>
</form>
<div class="nav-item" id="bouton-connexion">
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#connexion_modal">SE CONNECTER</button>
</div>
<div id="deconnexion" style="display:none;">
<form method="post" action="{{ path('auth.logout') }}">
<!-- csrf_input() }}-->
<button class="btn btn-danger" style="font-size:14px;margin-left:0.5rem;">Se déconnecter</button>
</form>
</div>
<div class="nav-item" id="inscription">
<a class="nav-link" href="{{ path('account.signup') }}" style="font-size:14px;">S'inscrire</a>
</div>
{% endif %}
</div>
</nav>
{% if flash('success') %}
<div class="alert alert-success">
{{ flash('success') }}
</div>
{% endif %}
<div class="alert alert-danger" style="display:none;">
</div>
{% block body %}{% endblock %}
<div class="modal fade" id="connexion_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document" style="color: black;">
<div class="modal-content" style="text-align: left;">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Se connecter</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="pseudo">Pseudo</label>
<input type="text" id="pseudo" placeholder="Saisir votre pseudo SVP" class="form-control"/>
</div>
<div class="form-group">
<label for="mdp">Mot de passe</label>
<input type="password" id="mdp" class="form-control"/>
</div>
</div>
<div class="modal-body">
<button class="mdp_oublie" type="button" class="btn-default">
<a style="color:gray;" href="{{ path('auth.password') }}">Mot de passe oublié ?</a>
</button>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
<button type="submit" value="submit" class="btn btn-primary"
onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider</button>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
</div>
</body>
</html>