Merge pull request #94 from ZeusWPI/favicon

Favicon
This commit is contained in:
klaasg 2019-02-13 22:39:45 +01:00 committed by GitHub
commit e5a2fe48cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 1 deletions

BIN
app/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
app/static/logo_orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,7 +1,8 @@
from datetime import datetime, timedelta
from flask import url_for, render_template, abort
from flask import url_for, render_template, abort, send_from_directory
from flask_login import login_required
import os
from app import app
from models import Order, Location
@ -45,6 +46,14 @@ def profile():
return render_template('profile.html')
@app.route('/favicon.ico')
def favicon():
if len(get_orders((Order.stoptime > datetime.now()))) == 0:
return send_from_directory(os.path.join(app.root_path, 'static'), 'favicon.ico', mimetype='image/x-icon')
else:
return send_from_directory(os.path.join(app.root_path, 'static'), 'favicon_orange.ico', mimetype='image/x-icon')
if app.debug: # add route information
@app.route('/routes')
@login_required