From 626f8359cfd9970288690ae1ac44ec196dfa066b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Mogu=C3=A9rou?= Date: Mon, 15 May 2023 03:38:16 +0200 Subject: [PATCH] Ajout des fichiers --- .gitignore | 136 +++++++++++++++++++++++++++++++++ .htaccess | 18 +++++ app/__init__.py | 0 app/static/favicon.ico | Bin 0 -> 16958 bytes app/static/style.css | 100 ++++++++++++++++++++++++ app/templates/grades.html | 22 ++++++ app/templates/index.html | 14 ++++ app/templates/layout/base.html | 42 ++++++++++ app/templates/login.html | 0 app/templates/timetable.html | 11 +++ app/views.py | 37 +++++++++ passenger_wsgi.py | 9 +++ tmp/restart.txt | 0 13 files changed, 389 insertions(+) create mode 100644 .gitignore create mode 100644 .htaccess create mode 100644 app/__init__.py create mode 100644 app/static/favicon.ico create mode 100644 app/static/style.css create mode 100644 app/templates/grades.html create mode 100644 app/templates/index.html create mode 100644 app/templates/layout/base.html create mode 100644 app/templates/login.html create mode 100644 app/templates/timetable.html create mode 100644 app/views.py create mode 100644 passenger_wsgi.py create mode 100644 tmp/restart.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee13cfd --- /dev/null +++ b/.gitignore @@ -0,0 +1,136 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +.vscode/ +.well-known/ +.idea/ + +app/config.py +.htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..35defba --- /dev/null +++ b/.htaccess @@ -0,0 +1,18 @@ +RewriteEngine On + +RewriteCond %{HTTP_HOST} !^www\. +RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] + +RewriteCond %{HTTPS} off +RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] + +# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION BEGIN +PassengerAppRoot "/home/wdgl1530/antinote.fr" +PassengerBaseURI "/" +PassengerPython "/home/wdgl1530/virtualenv/antinote.fr/3.10/bin/python" +PassengerAppLogFile "/home/wdgl1530/logs/passenger.log" +# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION END +# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION BEGIN + + +# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION END diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/static/favicon.ico b/app/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..4bcb59ccefee79377bcaa5da42f40c5d2283c34e GIT binary patch literal 16958 zcmd^`TWl3Y7=X7R@&W>e@QQ)~x(5tIG%-F%eDKAD0PQIt0!mCxjEW)=9!hud3X&pf zfSy7v1X?a40c#aOOj|01dr2u5u~0As3YHcWY=QRo|96@0&fd=Kp524iX{NJtpYNZ4 zXaAj@BS{(fH*TDS{~wV?JSRzmBuN^99+M;$J*D3-2Z^Zzp)h+A`aDR)OVJ-h-+;au zeLE;J`DXMDpkyAza6PD*d61tu5tLyA@7K6f=@(XJjX~Ze$XAQL13kEUMFwPc^BtIX z6#b{5#zvxE8`N&NA z>^{$KdH(oynW*v~D2D|wZ%9AUafV$EK*~TJpMlIxfw-AGg76!4no$>WftI*5I#@Aj z2w85c?9uU~EHcYem4UAF z@sh~cBjwj@s!~v-9zpd0=e;0O_UQRh4`Pdh@Z<9>J9754@RJ^loa9FakeECa*;~60 zzuW@Ks39UU(C+!7cuiW^(>DLwT2LkOT!f;WS!rWWFF)D`nbW;=09L#>0NJl}TYgo( z?DfusYu>`NvZs6g$=1a8MkgJB;_-cvJv_Uf*hGAo_ODo5&G6pvzE&CFeLq)dydq3~ z%7~5GY}=-Ot;Xiq_!IFuSN^&RfQG%i|KSs{`DL;=^)p|e+S|UsU@2b+aD0d1t5zC$ zUNYM7rcuXSzjnJ<{dzM$6lRTeWvB5UD+il9cR-wf%UoM^=(r28c9t>5!&~?==Z_e9 zZu}pO1-Q|~*JH8vo8I+J`-%8&x73q=>wMO#5#DJBD1J#y1_w79_1M+~+}!@t)-|HzJ_Holq1k3@(+b{5Cs@4Ho1A>R+h_N+E|7#D@sXXcG7ST2Vz zE6V@n3jlZT@O_gFwS2tJPjWRo5q?F!iu~ z`7+cN8^6{5J5yuiX*PtVIePXkdfF)S;}X7rIKMyrr!ntZ%J)SvN~1jHo6hiMnj4Kg zR)#`1{`#GI9zE}xe&ySuSj7iMU20=z0bfRhU)O(s>mQA|cp5$Dzn4rNjLxgSZ2H+Oj3s$%06`nmXKRy3)HaO0Unbqmqy57(j=^dWRUO38+_|i#db}Gx}(0c#Z zpbSX{R!4R}t78s>>Hm7mdAeh9s5mJayljM+ZQ5sC6A?`y5U>dlcCYW>3#lR>mtVnaS6y^xQw^_P;g$|NHlkFQz?&I`F^!{-xgo+3yEl2bezl z4ZUvPke%ceTuk%r*MZxIaW)mo*`#Z6-G~5qOhowCI57{H0PZKQ@(d`3dpe z__N4mkP4Sr-7Y)V4?C6B&%))bjZ_9=3<1}I%(7I@ziKkr9DndXdHz|AeV6L_XQnTp z$-u{VLO-@bH1l5?7JHWr6s1Qb>p}SZ1*z&hV|EJhUchhW@s`lmgs}Kk`3C-Oa*ETK z!%jmx`7z`V$3_Z+UzKYhZ{*OhIlbD`e;c9w{w=lhvZ?Vm;~9?GQR=&w3@A@~XVTBj z277l7!mrBLa8E>q`J)CT8(+Hef%XsdJ(Lr^)&_t4_4pgNxlZR-)5R&$4`};|+MX)y zsd=9*^WxX`sO37G>jF?mjuq+q-&RKZzMy?$$yV-tYdefGp>r2>zud<8B!3Nm$9fhy z599B)%J4cL&uM3Y`Z)cRKT?NVwPfg`Ym=nG6jn-7PYS794DM3+td^}6Xr*{Rt(aC& zrFe#394mBERFV`HYSpm;Y@OU-tvWWq!bUAw>dnGRNpn4|p{l26SVKMe{{6R(hs7)P zA=x+@_4M8>WO863lM|C0lOqeYX`zWxsUehmC51R)S_3#QS_6ZPd1Ld~HLq-*^?CmX D+b+LE literal 0 HcmV?d00001 diff --git a/app/static/style.css b/app/static/style.css new file mode 100644 index 0000000..0b9fd0d --- /dev/null +++ b/app/static/style.css @@ -0,0 +1,100 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: Montserrat, sans-serif; +} + +#identification { + padding: 5px 0; + text-align: center; +} + +#schoolid { + text-transform: uppercase; + font-size: 130%; + font-weight: 600; +} + +#userid { + font-size: 110%; + font-weight: 600; +} + +#navbar { + height: 50px; + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #46484d; +} + +#navbar li { + float: left; + height: 45px; +} + +#navbar li a { + font-weight: bold; + display: block; + color: white; + text-align: center; + line-height: 15px; + padding: 17px 10px 13px; + text-decoration: none; +} + +#navbar li a:hover { + background-color: #ffffff; + border-bottom: 5px solid var(--theme-color); + color: black; + transition: 500ms background-color, 500ms color; +} + +#navbar li a.active { + background-color: #ffffff; + border-bottom: 10px solid var(--theme-color); + color: black; +} + +#navbar a.accueil { + font-size: 20px; + padding: 13px 10px 12px; +} + + +#liste-notes { + border: 1px solid gray; + width: clamp(300px, 30%, 1200px); +} + +#liste-notes .section { + display: block; + padding: 5px; + border-bottom: 1px solid black; +} + +#liste-notes .section:hover { + background-color: var(--theme-color-light); +} + +#liste-notes ul li { + padding: 5px; +} + +#liste-notes ul li:hover { + background-color: var(--theme-color-light); +} + + + +footer { + background-color: #46484d; + text-align: center; + color: white; + padding: 10px 0; +} diff --git a/app/templates/grades.html b/app/templates/grades.html new file mode 100644 index 0000000..6375858 --- /dev/null +++ b/app/templates/grades.html @@ -0,0 +1,22 @@ +{# grades.html #} + +{% extends "layout/base.html" %} + +{% block title %}Mes notes | Antinote{% endblock %} + +{% block main %} + +

Mes notes

+ +
    +
  • + Mathématiques +
      +
    • 12/20
    • +
    • 15/20
    • +
    +
  • +
  • Philosophie
  • +
+ +{% endblock %} \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..2f9b1f6 --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,14 @@ +{% extends "layout/base.html" %} + +{% block title %}Accueil | Antinote{% endblock %} + +{% block main %} + +

Bienvenue sur Antinote !

+ +Ce site est encore en construction. yo + +{{ session }} + + +{% endblock %} \ No newline at end of file diff --git a/app/templates/layout/base.html b/app/templates/layout/base.html new file mode 100644 index 0000000..8769a2c --- /dev/null +++ b/app/templates/layout/base.html @@ -0,0 +1,42 @@ +{# layout/base.html.j2 #} + + + + + + + + + + {% block title %}{% endblock %} + + + +
+
+
Lycée polyvalent Alain-René Lesage
+
Espace Élèves - NOM Prénom (Classe)
+
+ +
+
+ {% block main %}{% endblock %} +
+
+ © Antinote {{year}} +
+ + diff --git a/app/templates/login.html b/app/templates/login.html new file mode 100644 index 0000000..e69de29 diff --git a/app/templates/timetable.html b/app/templates/timetable.html new file mode 100644 index 0000000..dc6d7cb --- /dev/null +++ b/app/templates/timetable.html @@ -0,0 +1,11 @@ +{% extends "layout/base.html" %} + +{% block title %}Accueil | Antinote{% endblock %} + +{% block main %} + +

Emploi du temps

+ +Ce site est encore en construction. + +{% endblock %} \ No newline at end of file diff --git a/app/views.py b/app/views.py new file mode 100644 index 0000000..9d17e28 --- /dev/null +++ b/app/views.py @@ -0,0 +1,37 @@ +from flask import Flask, request, session +from flask import render_template, send_from_directory +import os +import sys + +from datetime import datetime + +sys.path.insert(0, os.path.dirname(__file__)) + +app = Flask(__name__) +app.config.from_object("config") + +app.jinja_env.globals.update({ + "year": datetime.now().year, + "menuitems": [ + ('/', '', 'accueil'), + ('/grades/', 'Mes notes', ''), + ('/timetable/', 'Emploi du temps', '') + ] +}) + +@app.route("/") +def index(): + return render_template("index.html") + +@app.route("/grades/") +def grades(): + return render_template("grades.html") + +@app.route("/timetable/") +def timetable(): + return render_template("timetable.html") + +@app.route('/favicon.ico') +def favicon(): + return send_from_directory(os.path.join(app.root_path, 'static'), + 'favicon.ico',mimetype='image/vnd.microsoft.icon') diff --git a/passenger_wsgi.py b/passenger_wsgi.py new file mode 100644 index 0000000..35cb3c5 --- /dev/null +++ b/passenger_wsgi.py @@ -0,0 +1,9 @@ +import imp +import os +import sys + + +sys.path.insert(0, os.path.dirname(__file__)) + +wsgi = imp.load_source('wsgi', 'app/views.py') +application = wsgi.app \ No newline at end of file diff --git a/tmp/restart.txt b/tmp/restart.txt new file mode 100644 index 0000000..e69de29