|
|
|
@ -1,10 +1,8 @@
|
|
|
|
|
import re
|
|
|
|
|
import sys
|
|
|
|
|
import json
|
|
|
|
|
import logging
|
|
|
|
|
from logging import config
|
|
|
|
|
import yaml
|
|
|
|
|
from flask import Flask, render_template, redirect, request, url_for
|
|
|
|
|
from flask import Flask, render_template, redirect, url_for
|
|
|
|
|
from flask_minify import minify
|
|
|
|
|
from thsf.backend import Backend
|
|
|
|
|
from thsf.schedule import Schedule
|
|
|
|
@ -37,7 +35,8 @@ try:
|
|
|
|
|
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"])
|
|
|
|
|
apikey=app.local_config["pretalx"]["apikey"],
|
|
|
|
|
ssl_verify=app.local_config["pretalx"]["ssl_verify"])
|
|
|
|
|
schedule = Schedule()
|
|
|
|
|
navbar = Navbar(config=app.local_config["navbar"])
|
|
|
|
|
except Exception as err:
|
|
|
|
@ -47,6 +46,7 @@ except Exception as err:
|
|
|
|
|
if app.local_config["log"]["root"]["level"] != "DEBUG":
|
|
|
|
|
minify(app=app, html=True, js=True, cssless=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# -- Tools
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
@ -63,7 +63,7 @@ def get_speaker_biography(code):
|
|
|
|
|
try:
|
|
|
|
|
speaker_info = backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/speakers/{code}/").json()
|
|
|
|
|
return speaker_info.get("biography").strip()
|
|
|
|
|
except Exception as err:
|
|
|
|
|
except Exception:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -125,9 +125,10 @@ def planning():
|
|
|
|
|
for slot in slots.get("slots"):
|
|
|
|
|
for speaker in slot.get("speakers"):
|
|
|
|
|
speaker["biography"] = get_speaker_biography(speaker.get("code"))
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/planning"),
|
|
|
|
|
filter=["concert", "dj set", "panel discussion", "talk", "screening"])
|
|
|
|
|
|
|
|
|
@ -153,9 +154,10 @@ def goodies():
|
|
|
|
|
@app.route('/concerts', methods=['GET'])
|
|
|
|
|
def concerts():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/concerts"),
|
|
|
|
|
filter=["concert", "dj set"])
|
|
|
|
|
|
|
|
|
@ -163,9 +165,10 @@ def concerts():
|
|
|
|
|
@app.route('/workshops', methods=['GET'])
|
|
|
|
|
def workshops():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/workshops"),
|
|
|
|
|
filter=["workshop"])
|
|
|
|
|
|
|
|
|
@ -173,9 +176,10 @@ def workshops():
|
|
|
|
|
@app.route('/screenings', methods=['GET'])
|
|
|
|
|
def screenings():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/screenings"),
|
|
|
|
|
filter=["screening"])
|
|
|
|
|
|
|
|
|
@ -183,9 +187,10 @@ def screenings():
|
|
|
|
|
@app.route('/discussions', methods=['GET'])
|
|
|
|
|
def discussions():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/discussions"),
|
|
|
|
|
filter=["panel discussion"])
|
|
|
|
|
|
|
|
|
@ -193,9 +198,10 @@ def discussions():
|
|
|
|
|
@app.route('/exhibitions', methods=['GET'])
|
|
|
|
|
def exhibitions():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/exhibitions"),
|
|
|
|
|
filter=["installation"])
|
|
|
|
|
|
|
|
|
@ -203,9 +209,10 @@ def exhibitions():
|
|
|
|
|
@app.route('/talks', methods=['GET'])
|
|
|
|
|
def talks():
|
|
|
|
|
slots = get_slots()
|
|
|
|
|
slots = sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start"))
|
|
|
|
|
return render_template("planning.html",
|
|
|
|
|
slots=sorted(slots.get("slots"),
|
|
|
|
|
key=lambda slot: slot.get("slot").get("start")),
|
|
|
|
|
slots=slots,
|
|
|
|
|
navbar=navbar.get_from_page(page="/talks"),
|
|
|
|
|
filter=["talk", "light talk"])
|
|
|
|
|
|
|
|
|
|