wip beta
This commit is contained in:
98
src/thsf/__init__.py
Normal file
98
src/thsf/__init__.py
Normal file
@@ -0,0 +1,98 @@
|
||||
import sys
|
||||
import logging
|
||||
from logging import config
|
||||
import yaml
|
||||
from flask import Flask, render_template, redirect, request, url_for
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Configuration
|
||||
# ------------------------------------------------------------------------------
|
||||
class AppConfig:
|
||||
""" Flask application config """
|
||||
CONFIG_FILENAME = "config.yml"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Application
|
||||
# ------------------------------------------------------------------------------
|
||||
logger = logging.getLogger('wsgi')
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Local configuration
|
||||
# ------------------------------------------------------------------------------
|
||||
app.config.from_object(__name__ + '.AppConfig')
|
||||
try:
|
||||
with open(app.config["CONFIG_FILENAME"], "r") as local_config_file:
|
||||
app.local_config = yaml.load(local_config_file, Loader=yaml.SafeLoader)
|
||||
app.config["SECRET_KEY"] = app.local_config["app"]["secret_key"]
|
||||
app.config["LANGUAGES"] = app.local_config["app"]["languages"]
|
||||
config.dictConfig(app.local_config["log"])
|
||||
except Exception as err:
|
||||
logger.critical("[{}] {}".format(err.__class__, str(err)))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Tools
|
||||
# ------------------------------------------------------------------------------
|
||||
@app.errorhandler(404)
|
||||
def page_not_found(err):
|
||||
return redirect(url_for('index'))
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Routes
|
||||
# ------------------------------------------------------------------------------
|
||||
@app.route('/favicon.ico', methods=['GET'])
|
||||
def favicon():
|
||||
return redirect(url_for('static', filename='images/favicon.png'))
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def index():
|
||||
return render_template("index.html")
|
||||
|
||||
@app.route('/planning', methods=['GET'])
|
||||
def planning():
|
||||
return "planning"
|
||||
|
||||
@app.route('/concerts', methods=['GET'])
|
||||
def concerts():
|
||||
return "concerts"
|
||||
|
||||
@app.route('/djsets', methods=['GET'])
|
||||
def djsets():
|
||||
return "djsets"
|
||||
|
||||
@app.route('/exhibitions', methods=['GET'])
|
||||
def exhibitions():
|
||||
return "exhibitions"
|
||||
|
||||
@app.route('/lighttalks', methods=['GET'])
|
||||
def lighttalks():
|
||||
return "lighttalks"
|
||||
|
||||
@app.route('/paneldiscussions', methods=['GET'])
|
||||
def paneldiscussions():
|
||||
return "paneldiscussions"
|
||||
|
||||
@app.route('/screenings', methods=['GET'])
|
||||
def screenings():
|
||||
return "screenings"
|
||||
|
||||
@app.route('/talks', methods=['GET'])
|
||||
def talks():
|
||||
return "talks"
|
||||
|
||||
@app.route('/workshops', methods=['GET'])
|
||||
def workshops():
|
||||
return "workshops"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# -- Main
|
||||
# ------------------------------------------------------------------------------
|
||||
if __name__ == '__main__':
|
||||
app.run(host='127.0.0.1', port=5000, debug=True)
|
||||
111
src/thsf/static/css/style.css
Normal file
111
src/thsf/static/css/style.css
Normal file
@@ -0,0 +1,111 @@
|
||||
@font-face {
|
||||
font-family: pfdintextcomppromedium;
|
||||
src: url(../fonts/PFDinTextCompPro-Medium.ttf);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: pfdintextcompprothin;
|
||||
src: url(../fonts/PFDinTextCompPro-Thin.ttf);
|
||||
}
|
||||
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #e6007e;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto;
|
||||
background-position-x: center;
|
||||
font-family: pfdintextcomppromedium;
|
||||
}
|
||||
|
||||
span.header {
|
||||
font-size: 9.75em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
span.subheader {
|
||||
margin: 0;
|
||||
font-size: 3.47em;
|
||||
font-weight: thin;
|
||||
}
|
||||
|
||||
span.place {
|
||||
margin: 0;
|
||||
font-size: 2.145em;
|
||||
}
|
||||
|
||||
.white {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.black {
|
||||
color: #1A000D;
|
||||
}
|
||||
|
||||
.thin {
|
||||
font-family: pfdintextcompprothin;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-family: pfdintextcomppromedium;
|
||||
}
|
||||
|
||||
#main_wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#header {
|
||||
text-align: center;
|
||||
margin-bottom: -3em;
|
||||
}
|
||||
|
||||
#logo_wrapper {
|
||||
margin-top: 1em;
|
||||
width: 40em;
|
||||
}
|
||||
|
||||
img.logo {
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
#navbar_wrapper {
|
||||
margin-top: 1em;
|
||||
display: flex;
|
||||
flex-direction: line;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
gap: 2em;
|
||||
}
|
||||
|
||||
.button {
|
||||
font-size: 4em;
|
||||
transition-property: color;
|
||||
transition-duration: 1s;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
#cursorbar {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.cursor {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 0.75em solid transparent;
|
||||
border-right: 0.75em solid transparent;
|
||||
border-bottom: 0.75em solid #000000;
|
||||
}
|
||||
BIN
src/thsf/static/fonts/PFDinTextCompPro-Medium.ttf
Normal file
BIN
src/thsf/static/fonts/PFDinTextCompPro-Medium.ttf
Normal file
Binary file not shown.
BIN
src/thsf/static/fonts/PFDinTextCompPro-Thin.ttf
Normal file
BIN
src/thsf/static/fonts/PFDinTextCompPro-Thin.ttf
Normal file
Binary file not shown.
BIN
src/thsf/static/fonts/Uni Sans Bold.otf
Normal file
BIN
src/thsf/static/fonts/Uni Sans Bold.otf
Normal file
Binary file not shown.
BIN
src/thsf/static/fonts/Uni Sans Book.otf
Normal file
BIN
src/thsf/static/fonts/Uni Sans Book.otf
Normal file
Binary file not shown.
BIN
src/thsf/static/fonts/fontawesome-free-6.4.0-web.zip
Normal file
BIN
src/thsf/static/fonts/fontawesome-free-6.4.0-web.zip
Normal file
Binary file not shown.
BIN
src/thsf/static/images/affiche_v1.png
Normal file
BIN
src/thsf/static/images/affiche_v1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
src/thsf/static/images/bg.png
Normal file
BIN
src/thsf/static/images/bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
src/thsf/static/images/favicon.png
Executable file
BIN
src/thsf/static/images/favicon.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
301
src/thsf/static/images/logo.svg
Normal file
301
src/thsf/static/images/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 20 KiB |
BIN
src/thsf/static/images/pretalx-header.png
Normal file
BIN
src/thsf/static/images/pretalx-header.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
22
src/thsf/templates/base.html
Normal file
22
src/thsf/templates/base.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang='zxx'>
|
||||
<head>
|
||||
<title>THSF 2023: S/Extraire</title>
|
||||
<meta name="viewport" content="initial-scale=1.0" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet"
|
||||
href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<link rel="icon"
|
||||
type="image/png"
|
||||
href="{{ url_for('static', filename='images/favicon.png') }}" />
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
{% block headers %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
36
src/thsf/templates/index.html
Normal file
36
src/thsf/templates/index.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div id="main_wrapper">
|
||||
<div id="header_wrapper">
|
||||
<div id="header">
|
||||
<span class="header black bold">THSF</span>
|
||||
<span class="header white thin">2023</span>
|
||||
</div>
|
||||
<div id="subheader">
|
||||
<span class="subheader white thin">Toulouse Hacker Space Factory</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="place black thin">26 28 mai 2023 - </span>
|
||||
<span class="place white bold">CINÉMA UTOPIA BORDEROUGE</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="logo_wrapper">
|
||||
<img class="logo"
|
||||
src="{{ url_for('static', filename='images/logo.svg') }}"
|
||||
alt="THSF 2023 - S/Extraire"
|
||||
title="THSF 2023 - S/Extraire"/>
|
||||
</div>
|
||||
<div id="navbar_wrapper">
|
||||
<i class="button black fa-solid fa-guitar"></i>
|
||||
<i class="button black fa-solid fa-chalkboard"></i>
|
||||
<i class="button black fa-solid fa-compact-disc"></i>
|
||||
<i class="button black fa-solid fa-film"></i>
|
||||
<i class="button black fa-solid fa-people-group"></i>
|
||||
<i class="button black fa-solid fa-palette"></i>
|
||||
<i class="button black fa-solid fa-person-chalkboard"></i>
|
||||
</div>
|
||||
<div id="cursorbar">
|
||||
<div class="cursor"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
18
src/thsf/templates/planning.html
Normal file
18
src/thsf/templates/planning.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
{% block headers %}
|
||||
<script type="text/javascript" src="https://23.thsf.net/thsf-2023/schedule/widget/v2.en.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="thsf-schedule-wrapper">
|
||||
<pretalx-schedule event-url="https://23.thsf.net/thsf-2023/" locale="fr" format="list" style="--pretalx-clr-primary: #91AE2C"></pretalx-schedule>
|
||||
<noscript>
|
||||
<div class="pretalx-widget">
|
||||
<div class="pretalx-widget-info-message">
|
||||
JavaScript is disabled in your browser. To access our schedule without JavaScript,
|
||||
please <a target="_blank" href="https://23.thsf.net/thsf-2023/schedule/">click here</a>.
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
{% endblock %}
|
||||
5
src/thsf_wsgi.py
Normal file
5
src/thsf_wsgi.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from thsf import app
|
||||
|
||||
if __name__ == "__main__":
|
||||
application = app
|
||||
application.run(host="127.0.0.1", port=8043)
|
||||
Reference in New Issue
Block a user