beta #4

Merged
doug713705 merged 203 commits from beta into master 2023-04-21 00:11:59 +11:00
15 changed files with 256 additions and 251 deletions
Showing only changes of commit fb14588521 - Show all commits

View File

@ -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"))
# ------------------------------------------------------------------------------

View File

@ -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]

View File

@ -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 {

View File

@ -20,58 +20,8 @@
<body>
{% block content %}
{% endblock %}
<div id="navbar_wrapper">
<i class="button tooltip black fa-regular fa-calendar"
title="Programme"
alt="Programme"
onclick="document.location='/planning'">
<span class="tooltiptext thin">Programme</span>
</i>
<i class="button tooltip black fa-solid fa-map-location-dot"
title="Le Lieu"
alt="Le Lieu">
<span class="tooltiptext thin">Le lieu</span>
</i>
<i class="button tooltip black fa-solid fa-burger"
title="Restauration"
alt="Restauration">
<span class="tooltiptext thin">Restauration</span>
</i>
<i class="button tooltip black fa-solid fa-shirt"
title="T-shirt et goodies"
alt="T-shirt et goodies">
<span class="tooltiptext thin">Goodies</span>
</i>
<i class="button tooltip black fa-solid fa-guitar"
title="Concerts et DJ sets"
alt="Concerts et DJ sets">
<span class="tooltiptext thin">Concerts et DJ sets</span>
</i>
<i class="button tooltip black fa-solid fa-screwdriver-wrench"
title="Ateliers"
alt="Ateliers">
<span class="tooltiptext thin">Ateliers</span>
</i>
<i class="button tooltip black fa-solid fa-film"
title="Projections"
alt="Projections">
<span class="tooltiptext thin">Projections</span>
</i>
<i class="button tooltip black fa-solid fa-users-line"
title="Tables rondes"
alt="Tables rondes">
<span class="tooltiptext thin">Tables rondes</span>
</i>
<i class="button tooltip black fa-solid fa-palette"
title="Expositions"
alt="Expositions">
<span class="tooltiptext thin">Expositions</span>
</i>
<i class="button tooltip black fa-solid fa-person-chalkboard"
title="Présentation"
alt="Présentation">
<span class="tooltiptext thin">Présentation</span>
</i>
</div>
{% block navbar %}
{% include "navbar.html" %}
{% endblock %}
</body>
</html>

View File

@ -0,0 +1,9 @@
<div id="navbar_wrapper">
{% for item in navbar %}
<i class="button tooltip black {{ item['classes'] }}"
title="{{item['name']}}"
alt="{{item['name']}}"
onclick="document.location='{{item['url']}}'">
<span class="tooltiptext thin">{{item['name']}}</span>
</i>
{% endfor %}

View File

@ -9,11 +9,6 @@
{% for slot in slots %}
<div class="slot">
<div class="metadata">
<i class="button planning_tooltip black {{slot['submission_type']['fr'] | toicon }}"
title="{{slot['submission_type']['fr']}}"
alt="{{slot['submission_type']['fr']}}">
<span class="planning_tooltiptext thin">{{slot['submission_type']['fr']}}</span><span class="title white">{{slot["title"]}}</span>
</i>
<div class="speakers">
{% for speaker in slot["speakers"] %}
{{speaker["name"] | title}}
@ -28,12 +23,18 @@
{% endif %}
</div>
{% endif %}
</i> {{ ", " if not loop.last else "" }}
</i><br/>
{% endfor %}
</div>
<i class="button planning_tooltip black {{slot['submission_type']['fr'] | toicon }}"
title="{{slot['submission_type']['fr']}}"
alt="{{slot['submission_type']['fr']}}">
<span class="planning_tooltiptext thin">{{slot['submission_type']['fr']}}</span>
</i>
</div>
<div class="data">
<div class="details">
<div class="title black">{{slot["title"]}}</div>
<div class="room">{{slot["slot"]["room"]["fr"]}}</div>
<div class="start">{{slot["slot"]["start"] | date2dmyhm}} - {{slot["duration"]}} minutes ({{slot["content_locale"] | capitalize}})</div>
</div>
@ -43,20 +44,65 @@
{% endif %}
<p>{{slot["abstract"]}}</p>
</div>
<div class="description">{{slot["description"]}}</div>
{% if slot["resources"] %}
<div class="resources">
<h3>Ressources</h3>
{% for resource in slot["resources"] %}
<div class="resource">
<a class="thin" href="{{resource['resource']}}">{{resource["description"]}}</a>
</div>
{% endfor %}
</div>
{% endif %}
<!-- <div class="description">{{slot["description"]}}</div> -->
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
{% block navbar %}
<div id="navbar_wrapper">
<i class="button tooltip black fa-solid fa-house"
title="Accueil"
alt="Accueil"
onclick="document.location='/'">
<span class="tooltiptext thin">Accueil</span>
</i>
<i class="button tooltip black fa-solid fa-map-location-dot"
title="Le Lieu"
alt="Le Lieu">
<span class="tooltiptext thin">Le lieu</span>
</i>
<i class="button tooltip black fa-solid fa-burger"
title="Restauration"
alt="Restauration">
<span class="tooltiptext thin">Restauration</span>
</i>
<i class="button tooltip black fa-solid fa-shirt"
title="T-shirt et goodies"
alt="T-shirt et goodies">
<span class="tooltiptext thin">Goodies</span>
</i>
<i class="button tooltip black fa-solid fa-guitar"
title="Concerts et DJ sets"
alt="Concerts et DJ sets">
<span class="tooltiptext thin">Concerts et DJ sets</span>
</i>
<i class="button tooltip black fa-solid fa-screwdriver-wrench"
title="Ateliers"
alt="Ateliers">
<span class="tooltiptext thin">Ateliers</span>
</i>
<i class="button tooltip black fa-solid fa-film"
title="Projections"
alt="Projections">
<span class="tooltiptext thin">Projections</span>
</i>
<i class="button tooltip black fa-solid fa-users-line"
title="Tables rondes"
alt="Tables rondes">
<span class="tooltiptext thin">Tables rondes</span>
</i>
<i class="button tooltip black fa-solid fa-palette"
title="Expositions"
alt="Expositions">
<span class="tooltiptext thin">Expositions</span>
</i>
<i class="button tooltip black fa-solid fa-person-chalkboard"
title="Présentation"
alt="Présentation">
<span class="tooltiptext thin">Présentation</span>
</i>
</div>
{% endblock %}

View File

@ -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

View File

@ -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

View File

@ -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"))
# ------------------------------------------------------------------------------

View File

@ -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]

View File

@ -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 {

View File

@ -21,59 +21,7 @@
{% block content %}
{% endblock %}
{% block navbar %}
<div id="navbar_wrapper">
<i class="button tooltip black fa-regular fa-calendar"
title="Programme"
alt="Programme"
onclick="document.location='/planning'">
<span class="tooltiptext thin">Programme</span>
</i>
<i class="button tooltip black fa-solid fa-map-location-dot"
title="Le Lieu"
alt="Le Lieu">
<span class="tooltiptext thin">Le lieu</span>
</i>
<i class="button tooltip black fa-solid fa-burger"
title="Restauration"
alt="Restauration">
<span class="tooltiptext thin">Restauration</span>
</i>
<i class="button tooltip black fa-solid fa-shirt"
title="T-shirt et goodies"
alt="T-shirt et goodies">
<span class="tooltiptext thin">Goodies</span>
</i>
<i class="button tooltip black fa-solid fa-guitar"
title="Concerts et DJ sets"
alt="Concerts et DJ sets">
<span class="tooltiptext thin">Concerts et DJ sets</span>
</i>
<i class="button tooltip black fa-solid fa-screwdriver-wrench"
title="Ateliers"
alt="Ateliers">
<span class="tooltiptext thin">Ateliers</span>
</i>
<i class="button tooltip black fa-solid fa-film"
title="Projections"
alt="Projections">
<span class="tooltiptext thin">Projections</span>
</i>
<i class="button tooltip black fa-solid fa-users-line"
title="Tables rondes"
alt="Tables rondes">
<span class="tooltiptext thin">Tables rondes</span>
</i>
<i class="button tooltip black fa-solid fa-palette"
title="Expositions"
alt="Expositions">
<span class="tooltiptext thin">Expositions</span>
</i>
<i class="button tooltip black fa-solid fa-person-chalkboard"
title="Présentation"
alt="Présentation">
<span class="tooltiptext thin">Présentation</span>
</i>
</div>
{% include "navbar.html" %}
{% endblock %}
</body>
</html>

View File

@ -0,0 +1,9 @@
<div id="navbar_wrapper">
{% for item in navbar %}
<i class="button tooltip black {{ item['classes'] }}"
title="{{item['name']}}"
alt="{{item['name']}}"
onclick="document.location='{{item['url']}}'">
<span class="tooltiptext thin">{{item['name']}}</span>
</i>
{% endfor %}

View File

@ -9,11 +9,6 @@
{% for slot in slots %}
<div class="slot">
<div class="metadata">
<i class="button planning_tooltip black {{slot['submission_type']['fr'] | toicon }}"
title="{{slot['submission_type']['fr']}}"
alt="{{slot['submission_type']['fr']}}">
<span class="planning_tooltiptext thin">{{slot['submission_type']['fr']}}</span><span class="title white">{{slot["title"]}}</span>
</i>
<div class="speakers">
{% for speaker in slot["speakers"] %}
{{speaker["name"] | title}}
@ -28,12 +23,18 @@
{% endif %}
</div>
{% endif %}
</i> {{ ", " if not loop.last else "" }}
</i><br/>
{% endfor %}
</div>
<i class="button planning_tooltip black {{slot['submission_type']['fr'] | toicon }}"
title="{{slot['submission_type']['fr']}}"
alt="{{slot['submission_type']['fr']}}">
<span class="planning_tooltiptext thin">{{slot['submission_type']['fr']}}</span>
</i>
</div>
<div class="data">
<div class="details">
<div class="title black">{{slot["title"]}}</div>
<div class="room">{{slot["slot"]["room"]["fr"]}}</div>
<div class="start">{{slot["slot"]["start"] | date2dmyhm}} - {{slot["duration"]}} minutes ({{slot["content_locale"] | capitalize}})</div>
</div>
@ -44,16 +45,6 @@
<p>{{slot["abstract"]}}</p>
</div>
<!-- <div class="description">{{slot["description"]}}</div> -->
<!-- {% if slot["resources"] %}
<div class="resources">
<h3>Ressources</h3>
{% for resource in slot["resources"] %}
<div class="resource">
<a class="thin" href="{{resource['resource']}}">{{resource["description"]}}</a>
</div>
{% endfor %}
</div>
{% endif %} -->
</div>
</div>
{% endfor %}

View File

@ -1 +1 @@
81518
84302