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 %} diff --git a/build/lib/thsf/templates/navbar.html b/build/lib/thsf/templates/navbar.html new file mode 100644 index 0000000..a5db6f1 --- /dev/null +++ b/build/lib/thsf/templates/navbar.html @@ -0,0 +1,9 @@ + {% endfor %} {% endblock %} +{% block navbar %} + +{% endblock %} diff --git a/config.yml b/config.yml index c69b596..7b2544c 100644 --- a/config.yml +++ b/config.yml @@ -28,4 +28,38 @@ pretalx: apikey: bb770a53b15467dfb67c03d178004aca9e4819d6 event: thsf-2023 schedule: wip - +navbar: + items: + - name: Home + classes: fa-solid fa-house + url: / + - name: Programme + classes: fa-regular fa-calendar + url: /planning + - name: Lieu + classes: fa-solid fa-map-location-dot + url: /place + - name: Restauration + classes: fa-solid fa-burger + url: /food + - name: Goodies + classes: fa-solid fa-shirt + url: /goodies + - name: Concerts & DJ Sets + classes: fa-solid fa-guitar + url: /concerts + - name: Ateliers + classes: fa-solid fa-screwdriver-wrench + url: /workshops + - name: Projections + classes: fa-solid fa-film + url: /screenings + - name: Tables rondes + classes: fa-solid fa-users-line + url: /discussions + - name: Installations artistiques + classes: fa-solid fa-palette + url: /exhibitions + - name: Présentations + classes: fa-solid fa-person-chalkboard + url: /talks diff --git a/src/thsf.egg-info/SOURCES.txt b/src/thsf.egg-info/SOURCES.txt index 3d066dd..2b46146 100644 --- a/src/thsf.egg-info/SOURCES.txt +++ b/src/thsf.egg-info/SOURCES.txt @@ -10,6 +10,7 @@ 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/navbar/__init__.py src/thsf/schedule/__init__.py src/thsf/static/css/planning.css src/thsf/static/css/style.css @@ -25,4 +26,5 @@ 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/navbar.html src/thsf/templates/planning.html \ No newline at end of file diff --git a/src/thsf/__init__.py b/src/thsf/__init__.py index dca4cfe..234b825 100644 --- a/src/thsf/__init__.py +++ b/src/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/src/thsf/navbar/__init__.py b/src/thsf/navbar/__init__.py new file mode 100644 index 0000000..605c6ee --- /dev/null +++ b/src/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/src/thsf/static/css/planning.css b/src/thsf/static/css/planning.css index b94a499..7de853a 100644 --- a/src/thsf/static/css/planning.css +++ b/src/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/src/thsf/templates/base.html b/src/thsf/templates/base.html index 548e89a..468b50d 100644 --- a/src/thsf/templates/base.html +++ b/src/thsf/templates/base.html @@ -21,59 +21,7 @@ {% block content %} {% endblock %} {% block navbar %} - +{% include "navbar.html" %} {% endblock %} diff --git a/src/thsf/templates/navbar.html b/src/thsf/templates/navbar.html new file mode 100644 index 0000000..a5db6f1 --- /dev/null +++ b/src/thsf/templates/navbar.html @@ -0,0 +1,9 @@ + {% endfor %} diff --git a/thsf.pid b/thsf.pid index e8c42d5..fc4db8c 100644 --- a/thsf.pid +++ b/thsf.pid @@ -1 +1 @@ -81518 +84302