wip: programme

This commit is contained in:
mco-system
2023-04-09 22:13:29 +11:00
parent a1a9ce97ac
commit 170458b014
6 changed files with 98 additions and 34 deletions

View File

@@ -52,6 +52,9 @@ except Exception as err:
def page_not_found(err):
return redirect(url_for('index'))
def get_slots():
return backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}").json()
# ------------------------------------------------------------------------------
# -- Custom filters
# ------------------------------------------------------------------------------
@@ -87,7 +90,6 @@ def date2dmyhm(slot_type):
"Exposition": "fa-solid fa-palette"}
return slot_types[slot_type]
# ------------------------------------------------------------------------------
# -- Routes
# ------------------------------------------------------------------------------
@@ -103,10 +105,10 @@ def index():
@app.route('/planning', methods=['GET'])
def planning():
slots = backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}").json()
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/planning"))
@app.route('/place', methods=['GET'])
@@ -126,33 +128,57 @@ def goodies():
@app.route('/concerts', methods=['GET'])
def concerts():
return render_template("index.html",
navbar=navbar.get_from_page(page="/concerts"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/concerts"),
filter=["concerts", "dj set"])
@app.route('/workshops', methods=['GET'])
def workshops():
return render_template("index.html",
navbar=navbar.get_from_page(page="/workshops"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/workshops"),
filter=["workshop"])
@app.route('/screenings', methods=['GET'])
def screenings():
return render_template("index.html",
navbar=navbar.get_from_page(page="/screenings"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/screenings"),
filter=["screening"])
@app.route('/discussions', methods=['GET'])
def discussions():
return render_template("index.html",
navbar=navbar.get_from_page(page="/discussions"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/discussions"),
filter=["panel discussion"])
@app.route('/exhibitions', methods=['GET'])
def exhibitions():
return render_template("index.html",
navbar=navbar.get_from_page(page="/exhibitions"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/exhibitions"),
filter=["exhibition"])
@app.route('/talks', methods=['GET'])
def talks():
return render_template("index.html",
navbar=navbar.get_from_page(page="/talks"))
slots = get_slots()
return render_template("planning.html",
slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/talks"),
filter=["talk", "light talk"])
# ------------------------------------------------------------------------------

View File

@@ -2,7 +2,13 @@
{% block content %}
<div id="schedule">
{% for slot in slots %}
{% include "slot.html" %}
{% if filter %}
{% if slot.submission_type.en | lower in filter %}
{% include "slot.html" %}
{% endif %}
{% else %}
{% include "slot.html" %}
{% endif %}
{% endfor %}
</div>
{% endblock %}