From f2b425d74bd0e3f04034b9478dd5c7a7200aa8cc Mon Sep 17 00:00:00 2001 From: Sebastian Lobinger <sebastian.lobinger@fu-berlin.de> Date: Fri, 2 Jun 2017 11:48:33 +0200 Subject: [PATCH] update ExampleApp to demonstrate static files --- ExampleApp/Extra/__init__.py | 2 +- ExampleApp/Extra/static/.gitkeep | 0 ExampleApp/Extra/static/extra-style.css | 20 ++++++++++++++++++++ ExampleApp/Extra/templates/.gitkeep | 0 ExampleApp/Extra/templates/extra_home.html | 10 ++++++++++ ExampleApp/static/style.css | 2 +- 6 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 ExampleApp/Extra/static/.gitkeep create mode 100644 ExampleApp/Extra/static/extra-style.css create mode 100644 ExampleApp/Extra/templates/.gitkeep create mode 100644 ExampleApp/Extra/templates/extra_home.html diff --git a/ExampleApp/Extra/__init__.py b/ExampleApp/Extra/__init__.py index e189702..e5fbd15 100644 --- a/ExampleApp/Extra/__init__.py +++ b/ExampleApp/Extra/__init__.py @@ -1,4 +1,4 @@ from flask import render_template def home(): - return render_template('home.html') \ No newline at end of file + return render_template('extra_home.html') \ No newline at end of file diff --git a/ExampleApp/Extra/static/.gitkeep b/ExampleApp/Extra/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ExampleApp/Extra/static/extra-style.css b/ExampleApp/Extra/static/extra-style.css new file mode 100644 index 0000000..0ec7df2 --- /dev/null +++ b/ExampleApp/Extra/static/extra-style.css @@ -0,0 +1,20 @@ +body { + width:100%; + height:300px; + background:#fff; +} +#global_app_menu { + background:#ccc; +} + +#content { + background:#eee; +} + +#header { + background:#aaa; +} + +#footer { + background:#ccc; +} \ No newline at end of file diff --git a/ExampleApp/Extra/templates/.gitkeep b/ExampleApp/Extra/templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/ExampleApp/Extra/templates/extra_home.html b/ExampleApp/Extra/templates/extra_home.html new file mode 100644 index 0000000..867021b --- /dev/null +++ b/ExampleApp/Extra/templates/extra_home.html @@ -0,0 +1,10 @@ +{% extends "base-struct.html" %} +{% block title %}Index{% endblock %} +{% block head %} {{ super() }} +<link rel="stylesheet" href="/ExampleApp.Extra/static/extra-style.css" /> +{% endblock %} +{% block content %} + <h1>Extra</h1> + <p>samsHub Startseite: {{ app_lang['hello_message'] }}</p> +{% endblock %} +{% block header %}samsHUB -{% endblock %} \ No newline at end of file diff --git a/ExampleApp/static/style.css b/ExampleApp/static/style.css index 9daa380..25369da 100644 --- a/ExampleApp/static/style.css +++ b/ExampleApp/static/style.css @@ -8,7 +8,7 @@ body { } #content { - background:#cff; + background:#fcf; } #header { -- GitLab