Skip to content
Snippets Groups Projects
Commit 9952118e authored by Christian Elberfeld's avatar Christian Elberfeld
Browse files

rename static to files

parent 0c7149d1
No related branches found
No related tags found
No related merge requests found
File moved
File moved
File moved
File moved
......@@ -14,17 +14,17 @@ if __name__ == "__main__":
# Startseite
@app.route('/')
def hello_world():
def view_index():
return 'Warpzone API, see: https://gitlab.warpzone.ms/infrastruktur/warpapi/blob/master/README.md'
# Statische Dateien
@app.route('/static/<path:path>')
def send_static(path):
return send_from_directory('static', path)
@app.route('/files/<path:path>')
def send_file(path):
return send_from_directory('files', path)
# Statusanzeige auf der Webseite
@app.route('/wordpress')
def wordpress():
@app.route('/static')
def view_static():
spaceopen = False
now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w")
......@@ -36,11 +36,11 @@ def wordpress():
if dayofweek == "6":
if now.hour >= 18:
spaceopen = True
return render_template('wordpress.html', open = spaceopen)
return render_template('static.html', open = spaceopen)
# Statusanzeige auf der Webseite
@app.route('/status')
def staus():
def data_status():
spaceopen = 0
now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w")
......@@ -70,12 +70,12 @@ def staus():
# Endpunkt für Einbindung in cpu.ccc.de
# Eigentlich die SpaceAPI, aber so können einfacher Abweichungen implementiert werden
@app.route('/cccapi')
def cccapi():
def data_cccapi():
return redirect('/spaceapi', code=302)
# Implementierung der SpaceAPI
@app.route('/spaceapi')
def spaceapi():
def data_spaceapi():
spaceopen = False
now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w")
......@@ -90,7 +90,7 @@ def spaceapi():
data = {
"api": "0.13",
"space": "warpzone ",
"logo": "https://api.warpzone.ms/static/warpzone_logo.png",
"logo": "https://api.warpzone.ms/files/warpzone_logo.png",
"url": "https://www.warpzone.ms",
"location": {
"address": "warpzone e.V., Am Hawerkamp 31 Maus G, 48155 Münster, Germany",
......@@ -120,8 +120,8 @@ def spaceapi():
"state": {
"open": spaceopen,
"icon": {
"open": "https://api.warpzone.ms/static/warpzone_open.png",
"closed": "https://api.warpzone.ms/static/warpzone_closed.png",
"open": "https://api.warpzone.ms/files/warpzone_open.png",
"closed": "https://api.warpzone.ms/files/warpzone_closed.png",
},
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment