From 75e44fa9fde04cc6e1a1769c8fe38b4905a63f86 Mon Sep 17 00:00:00 2001 From: mco-system Date: Sun, 9 Apr 2023 17:29:44 +1100 Subject: [PATCH] wip: programme --- Makefile | 7 ++ build/lib/thsf/__init__.py | 7 +- build/lib/thsf/static/css/planning.css | 36 +++++---- build/lib/thsf/static/css/tooltip.css | 76 ++++++++++++------ build/lib/thsf/templates/base.html | 23 +++++- build/lib/thsf/templates/index.html | 17 ---- build/lib/thsf/templates/navbar.html | 9 +-- build/lib/thsf/templates/planning.html | 104 +------------------------ build/lib/thsf/templates/slot.html | 46 +++++++++++ src/thsf.egg-info/SOURCES.txt | 3 +- src/thsf/__init__.py | 7 +- src/thsf/static/css/planning.css | 34 ++++---- src/thsf/static/css/tooltip.css | 76 ++++++++++++------ src/thsf/templates/base.html | 23 +++++- src/thsf/templates/index.html | 17 ---- src/thsf/templates/navbar.html | 9 +-- src/thsf/templates/planning.html | 104 +------------------------ src/thsf/templates/slot.html | 46 +++++++++++ thsf.pid | 2 +- 19 files changed, 319 insertions(+), 327 deletions(-) create mode 100644 build/lib/thsf/templates/slot.html create mode 100644 src/thsf/templates/slot.html diff --git a/Makefile b/Makefile index 287ff3f..bb154db 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,13 @@ run: . thsf_venv/bin/activate; \ thsf_venv/bin/gunicorn -D -p thsf.pid -w 4 -b 127.0.0.1:8042 'thsf:app' +debug: + set -e ;\ + THSF_DIR=$$(pwd); \ + echo [+] Démarrage dans $$THSF_DIR; \ + . thsf_venv/bin/activate; \ + thsf_venv/bin/gunicorn -p thsf.pid -w 4 -b 127.0.0.1:8042 'thsf:app' + stop: -set -e;\ THSF_DIR=$$(pwd); \ diff --git a/build/lib/thsf/__init__.py b/build/lib/thsf/__init__.py index 234b825..c0043ae 100644 --- a/build/lib/thsf/__init__.py +++ b/build/lib/thsf/__init__.py @@ -52,6 +52,10 @@ except Exception as err: def page_not_found(err): return redirect(url_for('index')) +def get_days(): + days = ["26/05", "27/05", "28/05"] + return [{"title": f"Jour #{index+1}", "date": day} for index, day in enumerate(days)] + # ------------------------------------------------------------------------------ # -- Custom filters # ------------------------------------------------------------------------------ @@ -95,7 +99,8 @@ def index(): def planning(): slots = backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}").json() return render_template("planning.html", - slots=slots["slots"], + slots=sorted(slots["slots"], + key=lambda slot: slot["slot"]["start"]), navbar=navbar.get_from_page(page="/planning")) @app.route('/place', methods=['GET']) diff --git a/build/lib/thsf/static/css/planning.css b/build/lib/thsf/static/css/planning.css index 7de853a..0a207be 100644 --- a/build/lib/thsf/static/css/planning.css +++ b/build/lib/thsf/static/css/planning.css @@ -9,23 +9,28 @@ .slot { display: flex; + flex: 1; + justify-content: center; + text-align: center; flex-direction: row; - align-items: flex-start; - align-content: flex-start; - margin: 1em; + margin: 0.3em; font-size: 2em; width: 22em; } +.slot_info { + display: flex; + flex-direction: row; + align-content: flex-start; +} + .metadata, .data { display: flex; flex-direction: column; justify-content: start; - align-items: flex-start; align-content: flex-start; padding: 0.5em; border-style: solid; - height: 8em; } .metadata { @@ -33,9 +38,10 @@ border-radius: 10px 0 0 10px; background-color: var(--alt-bg-color); color: var(--main-color); - border-color: var(--main-color); + border-color: var(--alt-bg-color); font-family: pfdintextcompprothin; border-width: 1px 0 0px 1px; + text-align: left; } .data { @@ -45,18 +51,18 @@ border-color: var(--main-color); border-width: 1px 1px 1px 0; font-family: pfdintextcompprothin; - overflow-y: auto; + text-align: left; } -.metadata > .button { +.metadata > .slot_info > .button { font-size: 1em; - margin-bottom: 1em; + margin-right: 0.3em; } .title { font-family: pfdintextcompprothin; font-weight: bold; - margin-bottom: 0.2em; + margin-bottom: 0.5em; } .speakers { @@ -82,7 +88,7 @@ bottom: 0; left: 0; opacity: 0; - transform: translateY(120%); + transform: translateX(-50%) translateY(102%); transition: opacity 1s; } @@ -100,7 +106,8 @@ padding: 0.2em; } -.speaker_details > .details > img, .data > .abstract > img { +.speaker_details > .details > img, +.abstract > img { max-width: 200px; max-height: 200px; float: left; @@ -112,15 +119,16 @@ font-size: 0.5em; } -.data > .abstract > p { +.abstract > p { text-align: justify; - font-size: 0.8em; + font-size: 1em; } .data > .details { font-family: pfdintextcompprothin; font-weight: bold; margin-bottom: 0.2em; + font-size: 0.8em; } .data > .resources > .resource > a { diff --git a/build/lib/thsf/static/css/tooltip.css b/build/lib/thsf/static/css/tooltip.css index 57ed009..7bbf8a8 100644 --- a/build/lib/thsf/static/css/tooltip.css +++ b/build/lib/thsf/static/css/tooltip.css @@ -1,9 +1,10 @@ -.tooltip, .planning_tooltip { +.tooltip, +.planning_tooltip, +.slot_tooltip { position: relative; display: inline-block; } - .tooltip .tooltiptext { visibility: hidden; background-color: var(--main-color); @@ -13,29 +14,13 @@ padding: 5px 0; position: absolute; z-index: 1; - bottom: 125%; - left: 50%; - margin-left: -60px; + bottom: 0; + left: 0; opacity: 0; + transform: translateX(-25%) translateY(-2em); transition: opacity 1s; } -.tooltip .tooltiptext::after, .planning_tooltip .planning_tooltiptext::after { - content: ""; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; -} - -.tooltip:hover .tooltiptext, .planning_tooltip:hover .planning_tooltiptext { - visibility: visible; - opacity: 1; - font-size: 0.7em; - padding: 0.2em; -} - .planning_tooltip .planning_tooltiptext { visibility: hidden; background-color: var(--main-color); @@ -48,6 +33,53 @@ bottom: 0; left: 0; opacity: 0; - transform: translateX(2em) translateY(-3em); + transform: translateX(2em); transition: opacity 1s; } + +.slot_tooltip .slot_tooltiptext { + visibility: hidden; + background-color: var(--main-color); + color: var(--alt-main-color); + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: absolute; + z-index: 1; + bottom: 0; + left: 0; + opacity: 0; + transform: translateX(2em) translateY(50%); + transition: opacity 1s; +} + +.slot_tooltip .slot_tooltiptext { + font-size: 1em; + width: 26em; + padding: 1em; + border-style: solid; + border-color: var(--alt-main-color); + border-width: 1px; +} + +.tooltip .tooltiptext::after, +.planning_tooltip .planning_tooltiptext::after, +.slot_tooltip .slot_tooltiptext::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; +} + +.tooltip:hover .tooltiptext, +.planning_tooltip:hover .planning_tooltiptext, +.slot_tooltip:hover .slot_tooltiptext { + visibility: visible; + opacity: 1; + font-size: 0.7em; + padding: 0.2em; +} + + diff --git a/build/lib/thsf/templates/base.html b/build/lib/thsf/templates/base.html index 468b50d..5a04f17 100644 --- a/build/lib/thsf/templates/base.html +++ b/build/lib/thsf/templates/base.html @@ -8,6 +8,8 @@ href="{{ url_for('static', filename='css/style.css') }}"> + @@ -18,8 +20,25 @@ -{% block content %} -{% endblock %} +
+
+
+ +
+ Toulouse Hacker Space Factory +
+
+ 26 28 mai 2023 - + CINÉMA UTOPIA BORDEROUGE +
+
+ {% block content %} + {% endblock %} +
+
{% block navbar %} {% include "navbar.html" %} {% endblock %} diff --git a/build/lib/thsf/templates/index.html b/build/lib/thsf/templates/index.html index 76ff3c3..b10e1e4 100644 --- a/build/lib/thsf/templates/index.html +++ b/build/lib/thsf/templates/index.html @@ -1,20 +1,5 @@ {% extends "base.html" %} {% block content %} -
-
-
- -
- Toulouse Hacker Space Factory -
-
- 26 28 mai 2023 - - CINÉMA UTOPIA BORDEROUGE -
-
Comme toujours, notre objectif est de créer un festival qui poétise les bifurcations de nos idées communes et qui réinvente le sens de certains schémas imposés par notre époque. Rejoignez-nous pour une expérience enrichissante et pleine de surprises !

-
-
{% endblock %} diff --git a/build/lib/thsf/templates/navbar.html b/build/lib/thsf/templates/navbar.html index a5db6f1..cd5cf08 100644 --- a/build/lib/thsf/templates/navbar.html +++ b/build/lib/thsf/templates/navbar.html @@ -1,9 +1,8 @@ diff --git a/build/lib/thsf/templates/planning.html b/build/lib/thsf/templates/planning.html index 7dc179f..b30a3a7 100644 --- a/build/lib/thsf/templates/planning.html +++ b/build/lib/thsf/templates/planning.html @@ -1,108 +1,8 @@ {% extends "base.html" %} -{% block headers %} - -{% endblock %} {% block content %} -
-
+
{% for slot in slots %} -
- -
-
-
{{slot["title"]}}
-
{{slot["slot"]["room"]["fr"]}}
-
{{slot["slot"]["start"] | date2dmyhm}} - {{slot["duration"]}} minutes ({{slot["content_locale"] | capitalize}})
-
-
- {% if slot['image'] %} - - {% endif %} -

{{slot["abstract"]}}

-
- -
-
+ {% include "slot.html" %} {% endfor %}
-
-{% endblock %} -{% block navbar %} - {% endblock %} diff --git a/build/lib/thsf/templates/slot.html b/build/lib/thsf/templates/slot.html new file mode 100644 index 0000000..6d83d0e --- /dev/null +++ b/build/lib/thsf/templates/slot.html @@ -0,0 +1,46 @@ +
+ +
+
+
{{slot.title}}
+
{{slot.slot.room.fr}}
+
{{slot.slot.start | date2dmyhm}} - {{slot.duration}} minutes ({{slot.content_locale | capitalize}})
+
+
+
diff --git a/src/thsf.egg-info/SOURCES.txt b/src/thsf.egg-info/SOURCES.txt index 2b46146..fa4e459 100644 --- a/src/thsf.egg-info/SOURCES.txt +++ b/src/thsf.egg-info/SOURCES.txt @@ -27,4 +27,5 @@ 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 +src/thsf/templates/planning.html +src/thsf/templates/slot.html \ No newline at end of file diff --git a/src/thsf/__init__.py b/src/thsf/__init__.py index 234b825..c0043ae 100644 --- a/src/thsf/__init__.py +++ b/src/thsf/__init__.py @@ -52,6 +52,10 @@ except Exception as err: def page_not_found(err): return redirect(url_for('index')) +def get_days(): + days = ["26/05", "27/05", "28/05"] + return [{"title": f"Jour #{index+1}", "date": day} for index, day in enumerate(days)] + # ------------------------------------------------------------------------------ # -- Custom filters # ------------------------------------------------------------------------------ @@ -95,7 +99,8 @@ def index(): def planning(): slots = backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}").json() return render_template("planning.html", - slots=slots["slots"], + slots=sorted(slots["slots"], + key=lambda slot: slot["slot"]["start"]), navbar=navbar.get_from_page(page="/planning")) @app.route('/place', methods=['GET']) diff --git a/src/thsf/static/css/planning.css b/src/thsf/static/css/planning.css index c587cb1..0a207be 100644 --- a/src/thsf/static/css/planning.css +++ b/src/thsf/static/css/planning.css @@ -9,23 +9,28 @@ .slot { display: flex; + flex: 1; + justify-content: center; + text-align: center; flex-direction: row; - align-items: flex-start; - align-content: flex-start; - margin: 1em; + margin: 0.3em; font-size: 2em; width: 22em; } +.slot_info { + display: flex; + flex-direction: row; + align-content: flex-start; +} + .metadata, .data { display: flex; flex-direction: column; justify-content: start; - align-items: flex-start; align-content: flex-start; padding: 0.5em; border-style: solid; - height: 8em; } .metadata { @@ -33,9 +38,10 @@ border-radius: 10px 0 0 10px; background-color: var(--alt-bg-color); color: var(--main-color); - border-color: var(--main-color); + border-color: var(--alt-bg-color); font-family: pfdintextcompprothin; border-width: 1px 0 0px 1px; + text-align: left; } .data { @@ -45,18 +51,18 @@ border-color: var(--main-color); border-width: 1px 1px 1px 0; font-family: pfdintextcompprothin; - overflow-y: auto; + text-align: left; } -.metadata > .button { +.metadata > .slot_info > .button { font-size: 1em; - margin-bottom: 1em; + margin-right: 0.3em; } .title { font-family: pfdintextcompprothin; font-weight: bold; - margin-bottom: 0.2em; + margin-bottom: 0.5em; } .speakers { @@ -100,7 +106,8 @@ padding: 0.2em; } -.speaker_details > .details > img, .data > .abstract > img { +.speaker_details > .details > img, +.abstract > img { max-width: 200px; max-height: 200px; float: left; @@ -112,15 +119,16 @@ font-size: 0.5em; } -.data > .abstract > p { +.abstract > p { text-align: justify; - font-size: 0.8em; + font-size: 1em; } .data > .details { font-family: pfdintextcompprothin; font-weight: bold; margin-bottom: 0.2em; + font-size: 0.8em; } .data > .resources > .resource > a { diff --git a/src/thsf/static/css/tooltip.css b/src/thsf/static/css/tooltip.css index 57ed009..7bbf8a8 100644 --- a/src/thsf/static/css/tooltip.css +++ b/src/thsf/static/css/tooltip.css @@ -1,9 +1,10 @@ -.tooltip, .planning_tooltip { +.tooltip, +.planning_tooltip, +.slot_tooltip { position: relative; display: inline-block; } - .tooltip .tooltiptext { visibility: hidden; background-color: var(--main-color); @@ -13,29 +14,13 @@ padding: 5px 0; position: absolute; z-index: 1; - bottom: 125%; - left: 50%; - margin-left: -60px; + bottom: 0; + left: 0; opacity: 0; + transform: translateX(-25%) translateY(-2em); transition: opacity 1s; } -.tooltip .tooltiptext::after, .planning_tooltip .planning_tooltiptext::after { - content: ""; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; -} - -.tooltip:hover .tooltiptext, .planning_tooltip:hover .planning_tooltiptext { - visibility: visible; - opacity: 1; - font-size: 0.7em; - padding: 0.2em; -} - .planning_tooltip .planning_tooltiptext { visibility: hidden; background-color: var(--main-color); @@ -48,6 +33,53 @@ bottom: 0; left: 0; opacity: 0; - transform: translateX(2em) translateY(-3em); + transform: translateX(2em); transition: opacity 1s; } + +.slot_tooltip .slot_tooltiptext { + visibility: hidden; + background-color: var(--main-color); + color: var(--alt-main-color); + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: absolute; + z-index: 1; + bottom: 0; + left: 0; + opacity: 0; + transform: translateX(2em) translateY(50%); + transition: opacity 1s; +} + +.slot_tooltip .slot_tooltiptext { + font-size: 1em; + width: 26em; + padding: 1em; + border-style: solid; + border-color: var(--alt-main-color); + border-width: 1px; +} + +.tooltip .tooltiptext::after, +.planning_tooltip .planning_tooltiptext::after, +.slot_tooltip .slot_tooltiptext::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; +} + +.tooltip:hover .tooltiptext, +.planning_tooltip:hover .planning_tooltiptext, +.slot_tooltip:hover .slot_tooltiptext { + visibility: visible; + opacity: 1; + font-size: 0.7em; + padding: 0.2em; +} + + diff --git a/src/thsf/templates/base.html b/src/thsf/templates/base.html index 468b50d..5a04f17 100644 --- a/src/thsf/templates/base.html +++ b/src/thsf/templates/base.html @@ -8,6 +8,8 @@ href="{{ url_for('static', filename='css/style.css') }}"> + @@ -18,8 +20,25 @@ -{% block content %} -{% endblock %} +
+
+
+ +
+ Toulouse Hacker Space Factory +
+
+ 26 28 mai 2023 - + CINÉMA UTOPIA BORDEROUGE +
+
+ {% block content %} + {% endblock %} +
+
{% block navbar %} {% include "navbar.html" %} {% endblock %} diff --git a/src/thsf/templates/index.html b/src/thsf/templates/index.html index 76ff3c3..b10e1e4 100644 --- a/src/thsf/templates/index.html +++ b/src/thsf/templates/index.html @@ -1,20 +1,5 @@ {% extends "base.html" %} {% block content %} -
-
-
- -
- Toulouse Hacker Space Factory -
-
- 26 28 mai 2023 - - CINÉMA UTOPIA BORDEROUGE -
-
Comme toujours, notre objectif est de créer un festival qui poétise les bifurcations de nos idées communes et qui réinvente le sens de certains schémas imposés par notre époque. Rejoignez-nous pour une expérience enrichissante et pleine de surprises !

-
-
{% endblock %} diff --git a/src/thsf/templates/navbar.html b/src/thsf/templates/navbar.html index a5db6f1..cd5cf08 100644 --- a/src/thsf/templates/navbar.html +++ b/src/thsf/templates/navbar.html @@ -1,9 +1,8 @@ diff --git a/src/thsf/templates/planning.html b/src/thsf/templates/planning.html index 7dc179f..b30a3a7 100644 --- a/src/thsf/templates/planning.html +++ b/src/thsf/templates/planning.html @@ -1,108 +1,8 @@ {% extends "base.html" %} -{% block headers %} - -{% endblock %} {% block content %} -
-
+
{% for slot in slots %} -
- -
-
-
{{slot["title"]}}
-
{{slot["slot"]["room"]["fr"]}}
-
{{slot["slot"]["start"] | date2dmyhm}} - {{slot["duration"]}} minutes ({{slot["content_locale"] | capitalize}})
-
-
- {% if slot['image'] %} - - {% endif %} -

{{slot["abstract"]}}

-
- -
-
+ {% include "slot.html" %} {% endfor %}
-
-{% endblock %} -{% block navbar %} - {% endblock %} diff --git a/src/thsf/templates/slot.html b/src/thsf/templates/slot.html new file mode 100644 index 0000000..6d83d0e --- /dev/null +++ b/src/thsf/templates/slot.html @@ -0,0 +1,46 @@ +
+ +
+
+
{{slot.title}}
+
{{slot.slot.room.fr}}
+
{{slot.slot.start | date2dmyhm}} - {{slot.duration}} minutes ({{slot.content_locale | capitalize}})
+
+
+
diff --git a/thsf.pid b/thsf.pid index fc4db8c..08a6f31 100644 --- a/thsf.pid +++ b/thsf.pid @@ -1 +1 @@ -84302 +89798