Skip to content
Snippets Groups Projects
Commit 3d5d418e authored by Milo Hivert's avatar Milo Hivert
Browse files

sytle de tout

parent d4aa5390
Branches
No related tags found
No related merge requests found
Showing
with 168 additions and 202 deletions
No preview for this file type
......@@ -17,6 +17,7 @@ body{
}
.wrapper{
margin-top: 0;
background-image: url("../images/bg.png");
background-attachment: fixed;
background-size: 100%;
......@@ -25,7 +26,7 @@ body{
@media (min-width : 50em){
.wrapper{
background-image: url("../images/banquet.png");
background-image: url("../images/banquet2.png");
background-attachment: fixed;
background-size: 100%;
padding: 10% 3% 3% 3%;
......@@ -281,6 +282,45 @@ position: relative;
}
.une_commande{
margin:1% 0;
margin:5px;
padding:1px;
padding-bottom: 7px;
border: 1px solid black;
border-radius:5px;
}
.une_commande p {
margin:3px;
padding:0;
text-align:center;
}
.commandes{
display: grid;
grid-template-columns: repeat( auto-fit, minmax(300px, 1fr));
text-align: center;
}
.bouton_gerer_commande{
text-decoration:none;
padding:0.5%;
margin:3px;
margin-top:7px;
border:1px solid black;
background-color: lightgrey;
color:black;
border-radius:5px;
transition: 100ms;
}
.bouton_gerer_commande:hover{
background-color: rgb(182, 182, 182);
}
.titre_page{
text-align:center;
font-weight:bold;
font-size:25px;
padding-bottom:10px;
}
\ No newline at end of file
site_campagne/campagne/static/campagne/images/banquet2.png

4.98 MiB

{% extends 'campagne/base.html'%}
{% load static %}
{% block cssEtTitre %}
<link rel="stylesheet" href="{% static 'campagne/css/hotline.css' %}" />
{% endblock %}
{% block content %}
<div class="commandes">
TOUTES LES COMMANDES NON PRISES EN CHARGE
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut != 'close' and commande.livreur.email != email %}
Commanditaire:{{commande.commanditaire}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le:{{commande.date}}
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes confiture : {{commande.crepe_confiture}}
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nutella : {{commande.crepe_nutella}}
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes sucre : {{commande.crepe_sucre}}
{% endif %}
{% if commande.statut == 'a traiter' %}
{{commande.pk}}
{% comment %} <a class="prendre en charge" href="../prendre_en_charge/{{commande.pk}}"> Prendre en charge</a> {% endcomment %}
<a class="prendre en charge" href="{% url 'prendre_en_charge' pkrequete=commande.pk %}"> Prendre en charge</a>
{% else %}
Commande en cours de livraison, livreur: {{commande.livreur.prenom}} {{commande.livreur.nom}}
{% endif%}
{% endif %}
</div>
{%endfor%}
<div>
<div class="mes_commandes">
TOUTES MES LIVRAISONS
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut != 'close' and commande.livreur.email == email %}
Commanditaire:{{commande.commanditaire}}
Statut:{{commande.statut}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le:{{commande.date}}
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes nature : {{commande.crepe_confiture}}
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nature : {{commande.crepe_nutella}}
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes nature : {{commande.crepe_sucre}}
{% endif %}
{% comment %} <a class="clore" href="../clore/{{commande.pk}}">Clore la commande</a> {% endcomment %}
<a class="clore" href="{% url 'clore' pkrequete=commande.pk %}">Clore la commande</a>
{% endif %}
</div>
{%endfor%}
MES DERNIERES LIVRAISONS
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut == 'close' and commande.livreur.email == email %}
Commanditaire:{{commande.commanditaire}}
Statut:{{commande.statut}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le:{{commande.date}}
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes nature : {{commande.crepe_confiture}}
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nature : {{commande.crepe_nutella}}
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes nature : {{commande.crepe_sucre}}
{% endif %}
{% endif %}
</div>
{%endfor%}
<div>
{% endblock %}
\ No newline at end of file
......@@ -6,38 +6,39 @@
{% endblock %}
{% block content %}
<div class="commandes">
<p>TOUTES LES COMMANDES NON PRISES EN CHARGE</p>
<div class="wrapper">
<div class="block_commande">
<p>VIP</p>
<p class ="titre_page">TOUTES LES COMMANDES NON PRISES EN CHARGE</p>
<p class="titre_page">VIP</p>
<div class="commandes">
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut == 'a traiter' and commande.commanditaire.role != "cotisant" %}
Commanditaire:{{commande.commanditaire}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le:{{commande.date}}
<div class="une_commande">
<p>Commanditaire: {{commande.commanditaire.prenom}} {{commande.commanditaire.nom}}</p>
<p>Adresse de Livraison: {{commande.adresse_livraison}}</p>
<p>Commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}</p>
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
<p>Crêpes nature : {{commande.crepe_nature}}</p>
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes confiture : {{commande.crepe_confiture}}
<p>Crêpes confiture : {{commande.crepe_confiture}}</p>
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nutella : {{commande.crepe_nutella}}
<p>Crêpes nutella : {{commande.crepe_nutella}}</p>
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes sucre : {{commande.crepe_sucre}}
{% endif %}
<a class="prendre en charge" href="{% url 'prendre_en_charge' pkrequete=commande.pk %}"> Prendre en charge</a>
<p>Crêpes sucre : {{commande.crepe_sucre}}</p>
{% endif %}
<a class="bouton_gerer_commande" href="{% url 'prendre_en_charge' pkrequete=commande.pk %}"> Prendre en charge</a>
</div>
{% endif %}
{%endfor%}
<div>
<div class="block_commande">
<p>COTISANTS</p>
</div>
<p class="titre_page">COTISANTS</p>
<div class="commandes">
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut == 'a traiter'%}
<div class="une_commande">
Commanditaire:{{commande.commanditaire}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}
......@@ -54,9 +55,10 @@
Crêpes sucre : {{commande.crepe_sucre}}
{% endif %}
<a class="prendre en charge" href="{% url 'prendre_en_charge' pkrequete=commande.pk %}"> Prendre en charge</a>
{% endif %}
</div>
{% endif %}
{%endfor%}
</div>
<div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -8,8 +8,6 @@
{% block content %}
<div class="wrapper">
<br>
<br>
<h1>
<div class="row" style="display: flex;">
<div class="column" style="flex: 10%;">
......
......@@ -6,32 +6,38 @@
{% endblock %}
{% block content %}
<div class="wrapper">
<div class="block_commande">
<p>Voici tes commandes</p>
<p class="titre_page">Voici tes commandes</p>
<div class="commandes">
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut != "close" and commande.commanditaire.email == email %}
Vous avez commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}:
<div class="une_commande">
<p>Vous avez commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}.</p>
<p>Adresse de Livraison: {{commande.adresse_livraison}}</p>
<p>Commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}</p>
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
<p>Crêpes nature : {{commande.crepe_nature}}</p>
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes confiture : {{commande.crepe_confiture}}
<p>Crêpes confiture : {{commande.crepe_confiture}}</p>
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nutella : {{commande.crepe_nutella}}
<p>Crêpes nutella : {{commande.crepe_nutella}}</p>
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes sucre : {{commande.crepe_sucre}}
<p>Crêpes sucre : {{commande.crepe_sucre}}</p>
{% endif %}
{% if commande.statut == "a traiter" %}
Votre commande n'est pas encore prise en charge
<a class="annuler" href="/annuler/{{commande.pk}}">Annuler la commande</a>
<p>Votre commande n'est pas encore prise en charge</p>
<a class="bouton_gerer_commande" href="/annuler/{{commande.pk}}">Annuler la commande</a>
{% else %}
{{commande.livreur.prenom}} {{commande.livreur.nom}} a pris en charge ta commande
{% endif %}
{% endif %}
</div>
{% endif %}
{%endfor%}
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -6,29 +6,33 @@
{% endblock %}
{% block content %}
<div class="wrapper">
<div class="block_commande">
TOUTES MES LIVRAISONS
<p class="titre_page">TOUTES MES LIVRAISONS</p>
<div class="commandes">
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut != 'close' and commande.livreur.email == email %}
Commanditaire:{{commande.commanditaire}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}
<div class="une_commande">
<p>Commanditaire: {{commande.commanditaire.prenom}} {{commande.commanditaire.nom}}</p>
<p>Adresse de Livraison: {{commande.adresse_livraison}}</p>
<p>Commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}</p>
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
<p>Crêpes nature : {{commande.crepe_nature}}</p>
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes nature : {{commande.crepe_confiture}}
<p>Crêpes confiture : {{commande.crepe_confiture}}</p>
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nature : {{commande.crepe_nutella}}
<p>Crêpes nutella : {{commande.crepe_nutella}}</p>
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes nature : {{commande.crepe_sucre}}
{% endif %}
<a class="clore" href="{% url 'clore' pkrequete=commande.pk %}">Clore la commande</a>
<p>Crêpes sucre : {{commande.crepe_sucre}}</p>
{% endif %}
<a class="bouton_gerer_commande" href="{% url 'clore' pkrequete=commande.pk %}">Clore la commande</a>
</div>
{% endif %}
{%endfor%}
<div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -6,28 +6,33 @@
{% endblock %}
{% block content %}
<div class="wrapper">
<div class="block_commande">
<p class="titre_page">Qui travaille ?<p>
<div class="commandes" >
{% for commande in commandes %}
<div class="une_commande">
{% if commande.statut == 'en cours' %}
Commanditaire:{{commande.commanditaire}}
Adresse de Livraison:{{commande.adresse_livraison}}
Commandée le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}
<div class="une_commande">
<p>Commanditaire: {{commande.commanditaire.prenom}} {{commande.commanditaire.nom}}</p>
<p>Adresse de Livraison: {{commande.adresse_livraison}}</p>
<p>Commandé le {{commande.date.day}}/{{commande.date.month}} à {{ commande.date.hour}}:{{commande.date.minute}}</p>
{% if commande.crepe_nature != 0 %}
Crêpes nature : {{commande.crepe_nature}}
<p>Crêpes nature : {{commande.crepe_nature}}</p>
{% endif %}
{% if commande.crepe_confiture != 0 %}
Crêpes confiture : {{commande.crepe_confiture}}
<p>Crêpes confiture : {{commande.crepe_confiture}}</p>
{% endif %}
{% if commande.crepe_nutella != 0 %}
Crêpes nutella : {{commande.crepe_nutella}}
<p>Crêpes nutella : {{commande.crepe_nutella}}</p>
{% endif %}
{% if commande.crepe_sucre != 0 %}
Crêpes sucre : {{commande.crepe_sucre}}
{% endif %}
Livreur: {{commande.livreur.prenom}} {{commande.livreur.nom}}
<p>Crêpes sucre : {{commande.crepe_sucre}}</p>
{% endif %}
<p>Livreur: {{commande.livreur.prenom}} {{commande.livreur.nom}}</p>
</div>
{% endif %}
{%endfor%}
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -5,7 +5,6 @@ from campagne.models import utilisateur, commande_crepe
from django.shortcuts import redirect
import requests
import json
# from cryptography.fernet import Fernet
from django.core.mail import send_mail
import datetime
......@@ -29,13 +28,13 @@ def decryptmess(message):
def connexion(request):
return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=https://astegifetobegif.cs-campus.fr/intermediaire&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
return HttpResponseRedirect('https://auth.viarezo.fr/oauth/authorize/?redirect_uri=http://localhost:8000&client_id=2fe828e15647fc92437727b6646ce5c799c40991&response_type=code&state=sqdkfjhsqdkf&scope=default')
def login(request): #on a le state et le authorization code dans le request
code = str(request.GET['code']),
state = str(request.GET['state'])
url = 'https://auth.viarezo.fr/oauth/token'
redirect_url = 'https://astegifetobegif.cs-campus.fr/intermediaire'
redirect_url = 'http://localhost:8000'
jso = requests.post(url, data={'grant_type':'authorization_code','code':code,'redirect_uri':redirect_url,'client_id':'2fe828e15647fc92437727b6646ce5c799c40991','client_secret':'f306614fc96833e80af693f2991901bc54a9cf9a'}).json()
access_token = jso['access_token']
r = requests.get("https://auth.viarezo.fr/api/user/show/me", headers={"Authorization" : "Bearer "+access_token})
......@@ -89,6 +88,7 @@ def commande_passee(request, requete):
token=decryptmess(token_crypté)
r = requests.get("https://auth.viarezo.fr/api/user/show/me", headers={"Authorization" : "Bearer "+token})
mail = r.json()['email']
if commande_crepe.objects.filter(commanditaire=utilisateur.objects.get(email=mail)).exists():
last_command_user=commande_crepe.objects.filter(commanditaire=utilisateur.objects.get(email=mail)).last()
date_derniere_commande=last_command_user.date
date_mtn = datetime.datetime.now()
......@@ -107,6 +107,7 @@ def commande_passee(request, requete):
# ['stepgifimstuck@gmail.com'])
return redirect(mes_commandes)
def mes_commandes(request):
test=check(request)
if test[0]:
......
No preview for this file type
No preview for this file type
......@@ -34,5 +34,5 @@ urlpatterns = [
path('connexion/',views.connexion, name="connexion"),
path('vip', views.vip, name='vip'),
path('intermediaire/', views.login, name="login"),
path('',views.accueil, name="accueil"),
path('',views.login, name="login"),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment