This commit is contained in:
mco-system
2023-04-06 01:14:50 +11:00
parent e72f8f4e64
commit 9ebcbbac56
28 changed files with 1339 additions and 181 deletions

98
src/thsf/__init__.py Normal file
View 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)

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

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

View 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 %}

View 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
View File

@@ -0,0 +1,5 @@
from thsf import app
if __name__ == "__main__":
application = app
application.run(host="127.0.0.1", port=8043)