beta #4

Merged
doug713705 merged 203 commits from beta into master 2023-04-21 00:11:59 +11:00
7 changed files with 54 additions and 30 deletions
Showing only changes of commit a93e39d984 - Show all commits

View File

@ -24,7 +24,8 @@ app:
real_url: https://www.thsf.net
pretalx:
url: https://23.thsf.net
apikey: sdfsdfsdf
apiprefix: api
apikey: bb770a53b15467dfb67c03d178004aca9e4819d6
event: thsf-2023
schedule: wip

View File

@ -3,3 +3,4 @@ wheel
flask
gunicorn
pyYAML
requests

View File

@ -22,6 +22,7 @@ install_requires =
flask
gunicorn
pyYAML
request
[options.packages.find]
where = src

View File

@ -3,6 +3,7 @@ import logging
from logging import config
import yaml
from flask import Flask, render_template, redirect, request, url_for
from thsf.backend import Backend
# ------------------------------------------------------------------------------
@ -30,6 +31,9 @@ try:
app.config["SECRET_KEY"] = app.local_config["app"]["secret_key"]
app.config["LANGUAGES"] = app.local_config["app"]["languages"]
config.dictConfig(app.local_config["log"])
backend = Backend(url=app.local_config["pretalx"]["url"],
apiprefix=app.local_config["pretalx"]["apiprefix"],
apikey=app.local_config["pretalx"]["apikey"])
except Exception as err:
logger.critical("[{}] {}".format(err.__class__, str(err)))
sys.exit(1)
@ -56,6 +60,7 @@ def index():
@app.route('/planning', methods=['GET'])
def planning():
backend.get(endpoint=f"events/{app.local_config['pretalx']['event']}/schedules/{app.local_config['pretalx']['schedule']}")
return "planning"
@app.route('/concerts', methods=['GET'])

View File

@ -0,0 +1,15 @@
import requests
class Backend(url, apiprefix, apikey):
def __init__(self, url, apiprefix, apikey):
self.url = url
self.apiprefix = apiprefix
self.apikey = apikey
self.session = requests.Session()
def get(self, endpoint, params=None):
url = f"{self.url}/{self.apiprefix}/{endpoint}"
headers = {f"Authorization: Token {self.apikey}"}
return self.session.get(url, **{"params": params, "headers": headers})

View File

@ -23,7 +23,8 @@
<div id="navbar_wrapper">
<i class="button tooltip black fa-regular fa-calendar"
title="Programme"
alt="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"

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block content %}
<div id="main_wrapper">
<div id="main_wrapper">
<div id="center_wrapper">
<div id="header_wrapper">
<div id="header">
@ -32,5 +32,5 @@
<p>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 !</p>
</div>
</div>
</div>
</div>
{% endblock %}