Ajout des fichiers

This commit is contained in:
Valentin Moguérou 2023-05-15 03:38:16 +02:00
parent 79a94cda35
commit 626f8359cf
13 changed files with 389 additions and 0 deletions

136
.gitignore vendored Normal file
View File

@ -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

18
.htaccess Normal file
View File

@ -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
<IfModule Litespeed>
</IfModule>
# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION END

0
app/__init__.py Normal file
View File

BIN
app/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

100
app/static/style.css Normal file
View File

@ -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;
}

22
app/templates/grades.html Normal file
View File

@ -0,0 +1,22 @@
{# grades.html #}
{% extends "layout/base.html" %}
{% block title %}Mes notes | Antinote{% endblock %}
{% block main %}
<h1>Mes notes</h1>
<ul id="liste-notes">
<li>
<span class="section">Mathématiques</span>
<ul>
<li>12/20</li>
<li>15/20</li>
</ul>
</li>
<li>Philosophie</li>
</ul>
{% endblock %}

14
app/templates/index.html Normal file
View File

@ -0,0 +1,14 @@
{% extends "layout/base.html" %}
{% block title %}Accueil | Antinote{% endblock %}
{% block main %}
<h1>Bienvenue sur Antinote&nbsp;!</h1>
Ce site est encore en construction. yo
{{ session }}
{% endblock %}

View File

@ -0,0 +1,42 @@
{# layout/base.html.j2 #}
<!DOCTYPE html>
<html lang="fr-fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/static/style.css" rel="stylesheet" type="text/css">
<script src="https://kit.fontawesome.com/0fd87250ec.js" crossorigin="anonymous"></script>
<title>{% block title %}{% endblock %}</title>
<style>
:root {
--theme-color: #00643c;
--theme-color-light: #caefe1;
}
</style>
</head>
<body>
<header>
<div id="identification">
<div id="schoolid">Lycée polyvalent Alain-René Lesage</div>
<div id="userid">Espace Élèves - NOM Prénom (Classe)</div>
</div>
<ul id="navbar">
{% for url, label, style in menuitems %}
{% if request.path == url %}
<li><a href="{{ url }}" class="active {{ style }}">{{ label|safe }}</a></li>
{% else %}
<li><a href="{{ url }}" class="{{ style }}">{{ label|safe }}</a></li>
{% endif %}
{% endfor %}
</ul>
</header>
<main>
{% block main %}{% endblock %}
</main>
<footer>
&copy; Antinote {{year}}
</footer>
</body>
</html>

0
app/templates/login.html Normal file
View File

View File

@ -0,0 +1,11 @@
{% extends "layout/base.html" %}
{% block title %}Accueil | Antinote{% endblock %}
{% block main %}
<h1>Emploi du temps</h1>
Ce site est encore en construction.
{% endblock %}

37
app/views.py Normal file
View File

@ -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": [
('/', '<i class="fa-solid fa-house-chimney"></i>', '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')

9
passenger_wsgi.py Normal file
View File

@ -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

0
tmp/restart.txt Normal file
View File