diff --git a/build/lib/thsf/__init__.py b/build/lib/thsf/__init__.py index dca4cfe..234b825 100644 --- a/build/lib/thsf/__init__.py +++ b/build/lib/thsf/__init__.py @@ -1,3 +1,4 @@ +import re import sys import json import logging @@ -6,6 +7,7 @@ import yaml from flask import Flask, render_template, redirect, request, url_for from thsf.backend import Backend from thsf.schedule import Schedule +from thsf.navbar import Navbar # ------------------------------------------------------------------------------ @@ -37,6 +39,7 @@ try: apiprefix=app.local_config["pretalx"]["apiprefix"], apikey=app.local_config["pretalx"]["apikey"]) schedule = Schedule() + navbar = Navbar(config=app.local_config["navbar"]) except Exception as err: logger.critical("[{}] {}".format(err.__class__, str(err))) sys.exit(1) @@ -73,6 +76,8 @@ def date2dmyhm(slot_type): "Atelier": "fa-solid fa-screwdriver-wrench", "Exposition": "fa-solid fa-palette"} return slot_types[slot_type] + + # ------------------------------------------------------------------------------ # -- Routes # ------------------------------------------------------------------------------ @@ -83,63 +88,60 @@ def favicon(): @app.route('/', methods=['GET']) def index(): - return render_template("index.html") - + return render_template("index.html", + navbar=navbar.get_from_page(page="/")) @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() - # 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() - - - + return render_template("planning.html", + slots=slots["slots"], + navbar=navbar.get_from_page(page="/planning")) +@app.route('/place', methods=['GET']) +def place(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/place")) +@app.route('/food', methods=['GET']) +def food(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/food")) +@app.route('/goodies', methods=['GET']) +def goodies(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/goodies")) @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" - + return render_template("index.html", + navbar=navbar.get_from_page(page="/concerts")) @app.route('/workshops', methods=['GET']) def workshops(): - return "workshops" + return render_template("index.html", + navbar=navbar.get_from_page(page="/workshops")) + +@app.route('/screenings', methods=['GET']) +def screenings(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/screenings")) + +@app.route('/discussions', methods=['GET']) +def discussions(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/discussions")) + +@app.route('/exhibitions', methods=['GET']) +def exhibitions(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/exhibitions")) + +@app.route('/talks', methods=['GET']) +def talks(): + return render_template("index.html", + navbar=navbar.get_from_page(page="/talks")) # ------------------------------------------------------------------------------ diff --git a/build/lib/thsf/navbar/__init__.py b/build/lib/thsf/navbar/__init__.py new file mode 100644 index 0000000..605c6ee --- /dev/null +++ b/build/lib/thsf/navbar/__init__.py @@ -0,0 +1,6 @@ +class Navbar: + def __init__(self, config): + self.config = config + + def get_from_page(self, page): + return [item for item in self.config["items"] if item["url"] != page] diff --git a/build/lib/thsf/static/css/planning.css b/build/lib/thsf/static/css/planning.css index b94a499..7de853a 100644 --- a/build/lib/thsf/static/css/planning.css +++ b/build/lib/thsf/static/css/planning.css @@ -25,7 +25,7 @@ align-content: flex-start; padding: 0.5em; border-style: solid; - height: 13em; + height: 8em; } .metadata { @@ -54,15 +54,15 @@ } .title { - font-family: pfdintextcomppromedium; - font-weight: 250; - margin-bottom: 0.5em; + font-family: pfdintextcompprothin; + font-weight: bold; + margin-bottom: 0.2em; } .speakers { font-family: pfdintextcompprothin; - font-weight: 250; - margin-bottom: 0.5em; + font-weight: bold; + margin-bottom: 0.2em; } .speaker_details { @@ -82,7 +82,7 @@ bottom: 0; left: 0; opacity: 0; - transform: translateX(2em) translateY(50%); + transform: translateY(120%); transition: opacity 1s; } @@ -114,13 +114,13 @@ .data > .abstract > p { text-align: justify; - font-size: 1em; + font-size: 0.8em; } .data > .details { - font-family: pfdintextcomppromedium; - font-weight: 250; - margin-bottom: 0.5em; + font-family: pfdintextcompprothin; + font-weight: bold; + margin-bottom: 0.2em; } .data > .resources > .resource > a { diff --git a/build/lib/thsf/templates/base.html b/build/lib/thsf/templates/base.html index 82005fc..468b50d 100644 --- a/build/lib/thsf/templates/base.html +++ b/build/lib/thsf/templates/base.html @@ -20,58 +20,8 @@
{% block content %} {% endblock %} - +{% block navbar %} +{% include "navbar.html" %} +{% endblock %}