Dashboard background image added to static/resources

This commit is contained in:
Fabio Manganiello 2019-02-24 20:10:58 +01:00
parent 2adab13d50
commit 0104037ada
4 changed files with 11 additions and 4 deletions

View file

@ -4,18 +4,21 @@ import re
from flask import Blueprint, abort, send_from_directory from flask import Blueprint, abort, send_from_directory
from platypush.config import Config from platypush.config import Config
from platypush.backend.http.app import template_folder, base_folder from platypush.backend.http.app import template_folder, static_folder
from platypush.backend.http.app.utils import authenticate, authentication_ok, \ from platypush.backend.http.app.utils import authenticate, authentication_ok, \
send_message send_message
img_folder = os.path.join(static_folder, 'resources', 'img')
resources = Blueprint('resources', __name__, template_folder=template_folder) resources = Blueprint('resources', __name__, template_folder=template_folder)
favicon = Blueprint('favicon', __name__, template_folder=template_folder) favicon = Blueprint('favicon', __name__, template_folder=template_folder)
img = Blueprint('img', __name__, template_folder=template_folder)
# Declare routes list # Declare routes list
__routes__ = [ __routes__ = [
resources, resources,
favicon, favicon,
img,
] ]
@resources.route('/resources/<path:path>', methods=['GET']) @resources.route('/resources/<path:path>', methods=['GET'])
@ -57,8 +60,12 @@ def resources_path(path):
@favicon.route('/favicon.ico', methods=['GET']) @favicon.route('/favicon.ico', methods=['GET'])
def favicon(): def favicon():
""" favicon.ico icon """ """ favicon.ico icon """
return send_from_directory(os.path.join(base_folder, 'static', 'resources'), return send_from_directory(img_folder, 'favicon.ico')
'favicon.ico')
@img.route('/img/<path:path>', methods=['GET'])
def imgpath(path):
""" Default static images """
return send_from_directory(img_folder, path)
# vim:sw=4:ts=4:et: # vim:sw=4:ts=4:et:

View file

@ -3,7 +3,7 @@ html {
} }
body { body {
background: rgba(240,240,245,1.0); background-image: url('/img/dashboard-background.jpg');
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
font-family: Lato; font-family: Lato;

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB