Lisätty favicon, korjattu tr()-funktio joka ei olettunut suomen kieleen (vaan kääntämättömään)

Sat, 10 Jun 2017 17:20:51 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 10 Jun 2017 17:20:51 +0300
changeset 11
e18ad36fbbf5
parent 10
843c6ee340e7
child 12
a47c9bde457d

Lisätty favicon, korjattu tr()-funktio joka ei olettunut suomen kieleen (vaan kääntämättömään)

service.py file | annotate | diff | comparison | revisions
static/favicon.png file | annotate | diff | comparison | revisions
templates/ajovuoro-suppea.html file | annotate | diff | comparison | revisions
templates/ajovuoro.html file | annotate | diff | comparison | revisions
templates/pysäkki.html file | annotate | diff | comparison | revisions
--- a/service.py	Sat Jun 10 17:00:53 2017 +0300
+++ b/service.py	Sat Jun 10 17:20:51 2017 +0300
@@ -1,5 +1,5 @@
 #!/usr/bin/env python3
-from flask import Flask, render_template, abort
+from flask import Flask, render_template, abort, send_from_directory
 from datetime import datetime, date, time, timedelta
 from os import path, listdir
 from configparser import ConfigParser
@@ -42,7 +42,7 @@
 			if request.args.get(language_name) is not None:
 				return language_name
 		else:
-			return None
+			return 'fi'
 
 @app.route('/pysäkki/<tunniste>')
 def pysäkkiaikataulu(tunniste):
@@ -114,6 +114,10 @@
 						yö = yö(datetime.combine(tänään(), time()) + ajovuoro.reitti[-1].saapumisaika),
 						)
 
+@app.route('/static/<path:path>')
+def static_file(path):
+	return send_from_directory(path.join('static', path))
+
 if __name__ == '__main__':
 	from argparse import ArgumentParser
 	parser = ArgumentParser()
Binary file static/favicon.png has changed
--- a/templates/ajovuoro-suppea.html	Sat Jun 10 17:00:53 2017 +0300
+++ b/templates/ajovuoro-suppea.html	Sat Jun 10 17:20:51 2017 +0300
@@ -1,5 +1,6 @@
 <html>
 <head>
+	<link rel="icon" type="image/png" href="/static/favicon.png" />
 	<meta charset='UTF-8' />
 
 	<style>
--- a/templates/ajovuoro.html	Sat Jun 10 17:00:53 2017 +0300
+++ b/templates/ajovuoro.html	Sat Jun 10 17:20:51 2017 +0300
@@ -1,5 +1,6 @@
 <html>
 <head>
+	<link rel="icon" type="image/png" href="/static/favicon.png" />
 	<meta charset='UTF-8' />
 
 	<style>
--- a/templates/pysäkki.html	Sat Jun 10 17:00:53 2017 +0300
+++ b/templates/pysäkki.html	Sat Jun 10 17:20:51 2017 +0300
@@ -1,5 +1,6 @@
 <html>
 <head>
+	<link rel="icon" type="image/png" href="/static/favicon.png" />
 	<meta charset='UTF-8' />
 
 	<style>

mercurial