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__": ...@@ -14,17 +14,17 @@ if __name__ == "__main__":
# Startseite # Startseite
@app.route('/') @app.route('/')
def hello_world(): def view_index():
return 'Warpzone API, see: https://gitlab.warpzone.ms/infrastruktur/warpapi/blob/master/README.md' return 'Warpzone API, see: https://gitlab.warpzone.ms/infrastruktur/warpapi/blob/master/README.md'
# Statische Dateien # Statische Dateien
@app.route('/static/<path:path>') @app.route('/files/<path:path>')
def send_static(path): def send_file(path):
return send_from_directory('static', path) return send_from_directory('files', path)
# Statusanzeige auf der Webseite # Statusanzeige auf der Webseite
@app.route('/wordpress') @app.route('/static')
def wordpress(): def view_static():
spaceopen = False spaceopen = False
now = datetime.datetime.now(pytz.timezone('Europe/Berlin')) now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w") dayofweek = now.strftime("%w")
...@@ -36,11 +36,11 @@ def wordpress(): ...@@ -36,11 +36,11 @@ def wordpress():
if dayofweek == "6": if dayofweek == "6":
if now.hour >= 18: if now.hour >= 18:
spaceopen = True spaceopen = True
return render_template('wordpress.html', open = spaceopen) return render_template('static.html', open = spaceopen)
# Statusanzeige auf der Webseite # Statusanzeige auf der Webseite
@app.route('/status') @app.route('/status')
def staus(): def data_status():
spaceopen = 0 spaceopen = 0
now = datetime.datetime.now(pytz.timezone('Europe/Berlin')) now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w") dayofweek = now.strftime("%w")
...@@ -70,12 +70,12 @@ def staus(): ...@@ -70,12 +70,12 @@ def staus():
# Endpunkt für Einbindung in cpu.ccc.de # Endpunkt für Einbindung in cpu.ccc.de
# Eigentlich die SpaceAPI, aber so können einfacher Abweichungen implementiert werden # Eigentlich die SpaceAPI, aber so können einfacher Abweichungen implementiert werden
@app.route('/cccapi') @app.route('/cccapi')
def cccapi(): def data_cccapi():
return redirect('/spaceapi', code=302) return redirect('/spaceapi', code=302)
# Implementierung der SpaceAPI # Implementierung der SpaceAPI
@app.route('/spaceapi') @app.route('/spaceapi')
def spaceapi(): def data_spaceapi():
spaceopen = False spaceopen = False
now = datetime.datetime.now(pytz.timezone('Europe/Berlin')) now = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
dayofweek = now.strftime("%w") dayofweek = now.strftime("%w")
...@@ -90,7 +90,7 @@ def spaceapi(): ...@@ -90,7 +90,7 @@ def spaceapi():
data = { data = {
"api": "0.13", "api": "0.13",
"space": "warpzone ", "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", "url": "https://www.warpzone.ms",
"location": { "location": {
"address": "warpzone e.V., Am Hawerkamp 31 Maus G, 48155 Münster, Germany", "address": "warpzone e.V., Am Hawerkamp 31 Maus G, 48155 Münster, Germany",
...@@ -120,8 +120,8 @@ def spaceapi(): ...@@ -120,8 +120,8 @@ def spaceapi():
"state": { "state": {
"open": spaceopen, "open": spaceopen,
"icon": { "icon": {
"open": "https://api.warpzone.ms/static/warpzone_open.png", "open": "https://api.warpzone.ms/files/warpzone_open.png",
"closed": "https://api.warpzone.ms/static/warpzone_closed.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