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): def page_not_found(err):
return redirect(url_for('index')) 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 # -- Custom filters
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -87,7 +90,6 @@ def date2dmyhm(slot_type):
"Exposition": "fa-solid fa-palette"} "Exposition": "fa-solid fa-palette"}
return slot_types[slot_type] return slot_types[slot_type]
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# -- Routes # -- Routes
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -103,10 +105,10 @@ def index():
@app.route('/planning', methods=['GET']) @app.route('/planning', methods=['GET'])
def planning(): 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", return render_template("planning.html",
slots=sorted(slots["slots"], slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]), key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/planning")) navbar=navbar.get_from_page(page="/planning"))
@app.route('/place', methods=['GET']) @app.route('/place', methods=['GET'])
@ -126,33 +128,57 @@ def goodies():
@app.route('/concerts', methods=['GET']) @app.route('/concerts', methods=['GET'])
def concerts(): def concerts():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/concerts")) 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']) @app.route('/workshops', methods=['GET'])
def workshops(): def workshops():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/workshops")) 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']) @app.route('/screenings', methods=['GET'])
def screenings(): def screenings():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/screenings")) 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']) @app.route('/discussions', methods=['GET'])
def discussions(): def discussions():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/discussions")) 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']) @app.route('/exhibitions', methods=['GET'])
def exhibitions(): def exhibitions():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/exhibitions")) 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']) @app.route('/talks', methods=['GET'])
def talks(): def talks():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/talks")) 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

@ -46,7 +46,7 @@
Et pour plus de 40€, vous recevrez <span class="important">un lot de 4 stickers, un T-Shirt, un Tote bag et un sweat-shirt</span> estampillés du logo de l'édition 2023 du THSF. Et pour plus de 40€, vous recevrez <span class="important">un lot de 4 stickers, un T-Shirt, un Tote bag et un sweat-shirt</span> estampillés du logo de l'édition 2023 du THSF.
</p> </p>
<p> <p>
Nous sommes également conscients que la situation économique actuelle est difficile. C'est pourquoi nous nous engageons à ce que <span class="important">toutes les sommes qui dépasseront notre objectif de financement de 2 000 € seront reversées aux caisses des grévistes de la réforme des retraites</span>. Ainsi, votre contribution permettra également de soutenir une cause importante et de <span class="important">faire une différence dans la vie de ceux qui se battent pour nos droits</span>. Nous sommes également conscients que la situation actuelle est particulièrement difficile. C'est pourquoi nous nous engageons à ce que <span class="important">toutes les sommes qui dépasseront notre objectif de financement de 2 000 € seront reversées aux caisses des grévistes de la réforme des retraites</span>. Ainsi, votre contribution permettra également de soutenir une cause importante et de <span class="important">faire une différence dans la vie de ceux qui se battent pour nos droits</span>.
</p> </p>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,13 @@
{% block content %} {% block content %}
<div id="schedule"> <div id="schedule">
{% for slot in slots %} {% 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 %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -52,6 +52,9 @@ except Exception as err:
def page_not_found(err): def page_not_found(err):
return redirect(url_for('index')) 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 # -- Custom filters
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -87,7 +90,6 @@ def date2dmyhm(slot_type):
"Exposition": "fa-solid fa-palette"} "Exposition": "fa-solid fa-palette"}
return slot_types[slot_type] return slot_types[slot_type]
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# -- Routes # -- Routes
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -103,10 +105,10 @@ def index():
@app.route('/planning', methods=['GET']) @app.route('/planning', methods=['GET'])
def planning(): 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", return render_template("planning.html",
slots=sorted(slots["slots"], slots=sorted(slots["slots"],
key=lambda slot: slot["slot"]["start"]), key=lambda slot: slot["slot"]["start"]),
navbar=navbar.get_from_page(page="/planning")) navbar=navbar.get_from_page(page="/planning"))
@app.route('/place', methods=['GET']) @app.route('/place', methods=['GET'])
@ -126,33 +128,57 @@ def goodies():
@app.route('/concerts', methods=['GET']) @app.route('/concerts', methods=['GET'])
def concerts(): def concerts():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/concerts")) 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']) @app.route('/workshops', methods=['GET'])
def workshops(): def workshops():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/workshops")) 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']) @app.route('/screenings', methods=['GET'])
def screenings(): def screenings():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/screenings")) 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']) @app.route('/discussions', methods=['GET'])
def discussions(): def discussions():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/discussions")) 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']) @app.route('/exhibitions', methods=['GET'])
def exhibitions(): def exhibitions():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/exhibitions")) 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']) @app.route('/talks', methods=['GET'])
def talks(): def talks():
return render_template("index.html", slots = get_slots()
navbar=navbar.get_from_page(page="/talks")) 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 %} {% block content %}
<div id="schedule"> <div id="schedule">
{% for slot in slots %} {% 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 %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1 +1 @@
95325 95888