Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions EcoleDirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ def getCloud(self):
else:
# self.token = connection.json()['token']
return connection.json()['data']

34 changes: 12 additions & 22 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@

from EcoleDirect import *
from flask import Flask
from flask import render_template, url_for, request, redirect
from flask import render_template, url_for, request, redirect , send_from_directory
from json import *

app = Flask(__name__)
app = Flask(__name__,static_folder='./templates')
utilisateur = EcoleDirect("LUDOVICDEBORDE", "Sylvainc1")


@app.route('/')
def index():

return f"""
<a href="./travail">travail</a>
</br></br>
<a href="./note">note</a>
</br></br>
<a href="./message">message</a>
"""


lien = ['travail','note','message']
return render_template('index.html',lien=lien)
@app.route('/travail')
def travail():
xzdfazfa = utilisateur.getHW()
json_dump = json.dumps(xzdfazfa)
json_object = json.loads(json_dump)

return render_template('travail.html',json_object=json_object)
@app.route('/travail/<jours>')
def travailjours(jours):
Expand All @@ -36,19 +27,14 @@ def travailjours(jours):
return render_template('travailjours.html',json_object=json_object)



@app.route('/note')
def note():
xzdfazfa = utilisateur.getNotes()
json_dump = json.dumps(xzdfazfa)
json_object = json.loads(json_dump)
test = " "
for y in json_object['notes']:
test = f"{y['libelleMatiere']}: {y['valeur']} / {y['noteSur']} pour une moyenne de classe à {y['moyenneClasse']}"
return f"""
{test}
"""

liste = " "
return render_template('note.html',json_object=json_object, liste=liste)

@app.route('/message')
def message():
xzdfazfa = utilisateur.getmes()
Expand All @@ -65,4 +51,8 @@ def message():
{test}
"""

app.run(host='0.0.0.0', port=80)



app.run(host='127.0.0.1', port=8080)

30 changes: 30 additions & 0 deletions templates/css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
* {
padding: 0px;
margin: 0px;
color: #ddccff;
}
body {
height: 100vh;
width: 100vw;
overflow: none;
background: #333;
}
.scroll{
padding: 50px;
height: calc(100vh - 100px);
display: flex;
align-items: center;
justify-content: space-evenly;
flex-direction: column;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 40px;
}
.link {
padding: 20px;
border: 1px solid #ddf;
border-radius: 20px;
font-size: 1.5em;
}
48 changes: 48 additions & 0 deletions templates/css/note.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
* {
color: #ffd;
}
body, html {
margin: 0px;
padding: 0px;
background: #333;
}
.boite {
padding: 25px;
border: 1px solid #ffd;
border-radius: 25px;
margin: 5vh;
display: flex;
align-items: center;
justify-content: space-evenly;
flex-direction: column;
}
.boite h1 {
text-align: center;
margin-bottom: 25px;
}
.boite text {
display: flex;
color: #33ff33;
}
.boite div {
position: relative;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.boite div .test {
margin-right: 25px;
font-size: 1.5rem;
}
.boite div .test p {
display: none;
cursor: pointer;
}
.boite div .test:hover {
font-size: 0px;
}
.boite div .test:hover p {
display: block;
font-size: 1.5rem;
}
35 changes: 35 additions & 0 deletions templates/css/travail.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body html, h1, p{
padding: 0px;
margin: 0px;
}
.jours {
position: relative;
margin-bottom: 10vh;
left: 50%;
transform: translate(-50%);
border: 1px solid currentColor;
border-radius: 40px;
padding: 50px 0px;
width: 80vw;
height: 10vh;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
cursor: pointer;
transition: 0.25s ease-in-out;
color: blueviolet;
}
.jours:hover {
background: #222;
color: hsl(241, 92%, 58%);
}
.jours h1 {
position: absolute;
top: 0px;
left: 50%;
transform: translate(-50%);
}
body, html {
background: #333
}
8 changes: 8 additions & 0 deletions templates/css/travailjours.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
body html, h1, p{
padding: 0px;
margin: 0px;
}
body, html {
background: #333;
color: coral;
}
25 changes: 25 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>école direct</title>
</head>
<body>
<link rel="stylesheet" href="/templates/css/index.css" type="text/css">
<div class="scroll">
<div class="link">
<a href="{{lien[0]}}">{{lien[0]}}</a>
</div>
<div class="link">
<a href="{{lien[1]}}">{{lien[1]}}</a>
</div>
<div class="link">
<a href="{{lien[2]}}">{{lien[2]}}</a>
</div>
</div>

</body>
</html>

52 changes: 52 additions & 0 deletions templates/note.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>notes</title>
</head>
<body>
<link rel="stylesheet" href="/templates/css/note.css" type="text/css">

<div class="boite">
<h1>histoire géographie</h1>
<div class="HIGEO"></div>
</div>
<div class="boite">
<h1>allemand</h1>
<div class="ALL2"></div>
</div>
<div class="boite">
<h1>physique chimie</h1>
<div class="PH-CH"></div>
</div>
<div class="boite">
<h1>anglais</h1>
<div class="AGL1"></div>
</div>
<div class="boite">
<h1>mathématique</h1>
<div class="MATHS"></div>
</div>


{%for i in json_object['notes']%}
<script>
over = document.createElement("p")
notesur = document.createTextNode("{{i['moyenneClasse']}}");
over.appendChild(notesur);
p = document.createElement("p")
p.classList.add("test");
note = document.createTextNode("{{i['valeur']}}/{{i['noteSur']}}");
p.appendChild(note);
p.appendChild(over);
document.getElementsByClassName("{{i['codeMatiere']}}")[0].appendChild(p);
</script>
{%endfor%}




</body>
</html>
43 changes: 3 additions & 40 deletions templates/travail.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>travail</title>
</head>
<body>

<link rel="stylesheet" href="/templates/css/travail.css" type="text/css">

{%for i in json_object.keys()%}
<div class="jours" onclick="window.location='./travail/{{i}}'"><h1>travail a faire pour le: {{i}}</h1>
Expand All @@ -24,42 +24,5 @@
{%endfor%}
</body>
</html>


<style>
body html, h1, p{
padding: 0px;
margin: 0px;
}
.jours {
position: relative;
margin-bottom: 10vh;
left: 50%;
transform: translate(-50%);
border: 1px solid currentColor;
border-radius: 40px;
padding: 50px 0px;
width: 80vw;
height: 10vh;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
cursor: pointer;
transition: 0.25s ease-in-out;
color: blueviolet;
}
.jours:hover {
background: #222;
color: hsl(241, 92%, 58%);
}
.jours h1 {
position: absolute;
top: 0px;
left: 50%;
transform: translate(-50%);
}
body, html {
background: #333
}
</style>


13 changes: 1 addition & 12 deletions templates/travailjours.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>devoir du {{json_object['date']}}</title>
</head>
<body>

<link rel="stylesheet" href="/templates/css/travailjours.css" type="text/css">


<br/><br/><br/>
Expand All @@ -27,14 +27,3 @@

</body>
</html>

<style>
body html, h1, p{
padding: 0px;
margin: 0px;
}
body, html {
background: #333;
color: coral;
}
</style>