From 77330dffe95d8fcb7a15e36d249a18c6a7988aae Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 26 Jan 2018 08:21:33 +0200 Subject: [PATCH] Refactor how url loading works for static files --- coffee_scale/urls.py | 6 +- .../css/{infoscreen_admin.css => admin.css} | 7 +- infoscreen/templates/base.html | 41 +++ infoscreen/templates/infoscreen_admin.html | 286 +++++++++--------- infoscreen/templates/infoscreen_index.html | 46 ++- infoscreen/urls.py | 6 +- kaehmy/forms.py | 3 +- kaehmy/static/css/base.css | 35 +++ kaehmy/static/css/footer.css | 34 +++ kaehmy/static/css/header.css | 37 +++ kaehmy/static/css/nav.css | 11 + kaehmy/static/css/readme.md | 0 kaehmy/templates/base.html | 4 + kaehmy/templates/navigation.html | 3 +- kaehmy/urls.py | 7 +- members/urls.py | 5 + static/css/base.css | 5 - templates/project.html | 6 + webapp/templates/ohlhafv/base.html | 1 - webapp/urls.py | 8 +- webapp/views.py | 2 +- 21 files changed, 371 insertions(+), 182 deletions(-) rename infoscreen/static/css/{infoscreen_admin.css => admin.css} (89%) create mode 100644 infoscreen/templates/base.html create mode 100644 kaehmy/static/css/base.css create mode 100644 kaehmy/static/css/footer.css create mode 100644 kaehmy/static/css/header.css create mode 100644 kaehmy/static/css/nav.css create mode 100644 kaehmy/static/css/readme.md delete mode 100644 static/css/base.css diff --git a/coffee_scale/urls.py b/coffee_scale/urls.py index f750576..acaa103 100644 --- a/coffee_scale/urls.py +++ b/coffee_scale/urls.py @@ -1,4 +1,5 @@ from django.conf.urls import url +from django.conf import settings from django.views.generic.base import RedirectView from .views import coffee_view @@ -6,7 +7,10 @@ from .views import coffee_view favicon_view = RedirectView.as_view(url='static/img/favicon.ico', permanent=True) urlpatterns = [ - # landing page url(r'^$', coffee_view), ] + +if settings.DEBUG: + from django.contrib.staticfiles.urls import staticfiles_urlpatterns + urlpatterns += staticfiles_urlpatterns() diff --git a/infoscreen/static/css/infoscreen_admin.css b/infoscreen/static/css/admin.css similarity index 89% rename from infoscreen/static/css/infoscreen_admin.css rename to infoscreen/static/css/admin.css index f4ceb48..5a43ebc 100644 --- a/infoscreen/static/css/infoscreen_admin.css +++ b/infoscreen/static/css/admin.css @@ -49,7 +49,12 @@ td { } } - #header { max-width: 100%; } + +.logout-button { + float: right; + margin-top: 10px; + margin-right: 30px; +} diff --git a/infoscreen/templates/base.html b/infoscreen/templates/base.html new file mode 100644 index 0000000..8091d50 --- /dev/null +++ b/infoscreen/templates/base.html @@ -0,0 +1,41 @@ +{% load i18n %} +{% load static %} +{% load staticfiles %} + + + +{% block html %} + + + + + {% block title %} + {% endblock title %} + + + {% block libraries %} + + + + + + + + + + {% endblock libraries %} + + {% block styles %} + + {% endblock styles %} + + {% block controllers %} + + {% endblock controllers %} + + + {% block body %} + {% endblock body %} + + +{% endblock html %} \ No newline at end of file diff --git a/infoscreen/templates/infoscreen_admin.html b/infoscreen/templates/infoscreen_admin.html index 9ab758e..4e57597 100644 --- a/infoscreen/templates/infoscreen_admin.html +++ b/infoscreen/templates/infoscreen_admin.html @@ -1,154 +1,154 @@ +{% extends "infoscreen:base.html" %} + {% load i18n %} {% load static %} {% load staticfiles %} - - - - - Infoscreen admin - - - - - - - - - - - -