wip: planning
This commit is contained in:
54
src/thsf.egg-info/PKG-INFO
Normal file
54
src/thsf.egg-info/PKG-INFO
Normal file
@@ -0,0 +1,54 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: thsf
|
||||
Version: 0.0.1
|
||||
Summary: "THSF website"
|
||||
Home-page: https://git.tetalab.org/tetalab/thsf.net
|
||||
Author: Doug Le Tough
|
||||
Author-email: doug@redatomik.org
|
||||
License: UNKNOWN
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Requires-Python: >=3.7
|
||||
Description-Content-Type: text/markdown
|
||||
Provides-Extra: dev
|
||||
|
||||
# THSF.NET
|
||||
|
||||
Le site du THSF
|
||||
|
||||
## Modifier le site
|
||||
|
||||
Il n'est **pas possible** de pousser directement des modifications sur la branche `master`.
|
||||
|
||||
Pour modifier le site, il est nécessaire de créer une branche spécifique et d'y pousser vos modifications.
|
||||
|
||||
## Publication du site
|
||||
|
||||
Lorsque vous êtes satisfaits de vos modifications, vous pouvez créer [une demande d'ajout](https://git.tetalab.org/tetalab/thsf.net/pulls) de votre branche sur la branche `master`.
|
||||
|
||||
Lorsque la demande de fusion sera acceptée (vous pouvez auto-accepter vos demandes de fusion), vos modifications seront automatiquement publiées sur [le site du THSF](https://www.thsf.net).
|
||||
|
||||
### Personnalisation de la publication
|
||||
|
||||
Afin de rendre le processus plus souple, il est possible de personnaliser la livraison en plaçant **à la racine du dépôt** un fichier `Makefile` contenant une cible `all` qui sera systématiquement exécutée.
|
||||
|
||||
C'est dans cette cible `all` que vous pourrez mettre toutes vos commandes personnalisées, typiquement l'installation de modules `python`, etc.
|
||||
|
||||
Le processus de publication est le suivant:
|
||||
|
||||
1. Le site actuellement en production est **supprimé**
|
||||
|
||||
2. La branche `master` du présent dépôt est cloné sur le serveur hébergeant le site du **THSF**
|
||||
|
||||
3. Si un fichier `Makefile` se trouve **à la racine du dépôt**, la cible `all` (i.e: `make all`) est automatiquement exécutée.
|
||||
|
||||
|
||||
## Contrôle de qualité et tests
|
||||
|
||||
Aucun contrôle de qualité ou de tests n'est mis en place. Vous êtes seuls sur le coup.
|
||||
|
||||
Soyez responsable et **testez vos modifications sur votre machine locale avant de fusionner votre branche** sur la branche `master`.
|
||||
|
||||
|
||||
28
src/thsf.egg-info/SOURCES.txt
Normal file
28
src/thsf.egg-info/SOURCES.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
MANIFEST.in
|
||||
README.md
|
||||
pyproject.toml
|
||||
setup.cfg
|
||||
setup.py
|
||||
src/thsf/__init__.py
|
||||
src/thsf.egg-info/PKG-INFO
|
||||
src/thsf.egg-info/SOURCES.txt
|
||||
src/thsf.egg-info/dependency_links.txt
|
||||
src/thsf.egg-info/requires.txt
|
||||
src/thsf.egg-info/top_level.txt
|
||||
src/thsf/backend/__init__.py
|
||||
src/thsf/schedule/__init__.py
|
||||
src/thsf/static/css/planning.css
|
||||
src/thsf/static/css/style.css
|
||||
src/thsf/static/css/tooltip.css
|
||||
src/thsf/static/fonts/PFDinTextCompPro-Medium.ttf
|
||||
src/thsf/static/fonts/PFDinTextCompPro-Thin.ttf
|
||||
src/thsf/static/fonts/Uni Sans Bold.otf
|
||||
src/thsf/static/fonts/Uni Sans Book.otf
|
||||
src/thsf/static/images/affiche_v1.png
|
||||
src/thsf/static/images/bg.png
|
||||
src/thsf/static/images/favicon.png
|
||||
src/thsf/static/images/logo.svg
|
||||
src/thsf/static/images/pretalx-header.png
|
||||
src/thsf/templates/base.html
|
||||
src/thsf/templates/index.html
|
||||
src/thsf/templates/planning.html
|
||||
1
src/thsf.egg-info/dependency_links.txt
Normal file
1
src/thsf.egg-info/dependency_links.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
18
src/thsf.egg-info/requires.txt
Normal file
18
src/thsf.egg-info/requires.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
flask
|
||||
gunicorn
|
||||
pyYAML
|
||||
requests
|
||||
pandas
|
||||
|
||||
[dev]
|
||||
twine
|
||||
build
|
||||
wheel>=0.37.0
|
||||
flake8>=4.0.1
|
||||
flake8-breakpoint>=1.1.0
|
||||
flake8-builtins>=1.5.3
|
||||
flake8-print>=4.0.0
|
||||
flake8-return>=1.1.3
|
||||
pep8-naming>=0.8.2
|
||||
setuptools>=60.9.2
|
||||
pylint>=2.12.2
|
||||
1
src/thsf.egg-info/top_level.txt
Normal file
1
src/thsf.egg-info/top_level.txt
Normal file
@@ -0,0 +1 @@
|
||||
thsf
|
||||
@@ -1,9 +1,11 @@
|
||||
import sys
|
||||
import json
|
||||
import logging
|
||||
from logging import config
|
||||
import yaml
|
||||
from flask import Flask, render_template, redirect, request, url_for
|
||||
# from thsf.backend import Backend
|
||||
from thsf.backend import Backend
|
||||
from thsf.schedule import Schedule
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -26,14 +28,15 @@ app = Flask(__name__)
|
||||
# ------------------------------------------------------------------------------
|
||||
app.config.from_object(__name__ + '.AppConfig')
|
||||
try:
|
||||
with open(app.config["CONFIG_FILENAME"], "r") as local_config_file:
|
||||
with open(app.config["CONFIG_FILENAME"], mode="r", encoding="utf-8") 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"])
|
||||
# backend = Backend(url=app.local_config["pretalx"]["url"],
|
||||
# apiprefix=app.local_config["pretalx"]["apiprefix"],
|
||||
# apikey=app.local_config["pretalx"]["apikey"])
|
||||
backend = Backend(url=app.local_config["pretalx"]["url"],
|
||||
apiprefix=app.local_config["pretalx"]["apiprefix"],
|
||||
apikey=app.local_config["pretalx"]["apikey"])
|
||||
schedule = Schedule()
|
||||
except Exception as err:
|
||||
logger.critical("[{}] {}".format(err.__class__, str(err)))
|
||||
sys.exit(1)
|
||||
@@ -54,43 +57,63 @@ def page_not_found(err):
|
||||
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():
|
||||
backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}")
|
||||
return "planning"
|
||||
slots = backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}").json()
|
||||
# schedule.set_slots(slots["slots"])
|
||||
return render_template("planning.html", slots=slots["slots"])
|
||||
# return "toto"
|
||||
# for slot in sched["slots"]:
|
||||
# schedule.add_slot(slot)
|
||||
# return schedule.df.to_html()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import requests
|
||||
import logging
|
||||
|
||||
|
||||
class Backend(url, apiprefix, apikey):
|
||||
class Backend:
|
||||
def __init__(self, url, apiprefix, apikey):
|
||||
self.url = url
|
||||
self.apiprefix = apiprefix
|
||||
@@ -10,6 +10,6 @@ class Backend(url, apiprefix, apikey):
|
||||
|
||||
def get(self, endpoint, params=None):
|
||||
url = f"{self.url}/{self.apiprefix}/{endpoint}"
|
||||
headers = {f"Authorization: Token {self.apikey}"}
|
||||
return self.session.get(url, **{"params": params, "headers": headers})
|
||||
|
||||
headers = {"Authorization": f"Token {self.apikey}",
|
||||
"Accept": "application/json"}
|
||||
return self.session.get(url, params=params, headers=headers)
|
||||
|
||||
6
src/thsf/schedule/__init__.py
Normal file
6
src/thsf/schedule/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
||||
class Schedule:
|
||||
def __init__(self):
|
||||
self.slots = list()
|
||||
|
||||
def set_slots(self, slots):
|
||||
self.slots = slots
|
||||
50
src/thsf/static/css/planning.css
Normal file
50
src/thsf/static/css/planning.css
Normal file
@@ -0,0 +1,50 @@
|
||||
#schedule {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
margin-bottom: 5em;
|
||||
}
|
||||
|
||||
.slot {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
margin: 1em;
|
||||
border-radius: 5px;
|
||||
border-color: var(--alt-color);
|
||||
background-color: var(--main-color);
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-size: 2em;
|
||||
width: 25em;
|
||||
}
|
||||
|
||||
.metadata {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
}
|
||||
|
||||
.data {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
.speaker_avatar {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.data_img {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
}
|
||||
@@ -1,18 +1,44 @@
|
||||
{% extends "base.html" %}
|
||||
{% block headers %}
|
||||
<script type="text/javascript" src="https://23.thsf.net/thsf-2023/schedule/widget/v2.en.js"></script>
|
||||
<link rel="stylesheet"
|
||||
href="{{ url_for('static', filename='css/planning.css') }}">
|
||||
{% 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 id="main_wrapper">
|
||||
<div id="#schedule">
|
||||
{% for slot in slots %}
|
||||
<div class="slot">
|
||||
<div class="metadata">
|
||||
<div class="title">{{slot["title"]}}</div>
|
||||
<div class="speakers">
|
||||
{% for speaker in slot["speakers"] %}
|
||||
<div class="speaker">
|
||||
<div class="name">{{speaker["name"]}}</div>
|
||||
<img class="speaker_avatar" src="{{speaker['avatar']}}"/>
|
||||
<div class="speaker_biography">{{speaker["biography"]}}</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="type">{{slot["submission_type"]["fr"]}}</div>
|
||||
<div class="start">{{slot["slot"]["start"]}}</div>
|
||||
<div class="duration">{{slot["duration"]}}</div>
|
||||
<div class="room">{{slot["slot"]["room"]["fr"]}}</div>
|
||||
<div class="locale">{{slot["content_locale"]}}</div>
|
||||
</div>
|
||||
</noscript>
|
||||
<div class="data">
|
||||
<div class="abstract">{{slot["abstract"]}}</div>
|
||||
<div class="description">{{slot["description"]}}</div>
|
||||
<img class="data_img" src="{{slot['image']}}"/>
|
||||
<div class="resources">
|
||||
{% for resource in slot["resources"] %}
|
||||
<div class="resources">
|
||||
<a href="{{resource['resource']}}">{{resource["description"]}}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user