From cd9043d8f30430d1c65e626b7d67b5157a5503d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20G=C3=B6tz?= Date: Tue, 9 Apr 2019 23:40:04 +0200 Subject: [PATCH] Bootstrap admin home page --- static/css/floating_labels.css | 42 +++++ templates/base.jinja2 | 12 +- templates/base_admin.jinja2 | 29 +++ templates/macros/utils_macros.jinja2 | 267 ++------------------------- templates/realm/realm_home.jinja2 | 32 ++-- 5 files changed, 110 insertions(+), 272 deletions(-) create mode 100644 templates/base_admin.jinja2 diff --git a/static/css/floating_labels.css b/static/css/floating_labels.css index 154526f..ab91dc0 100644 --- a/static/css/floating_labels.css +++ b/static/css/floating_labels.css @@ -69,3 +69,45 @@ font-size: 12px; color: #777; } + +/*SIDEBAR*/ +.sidebar-wrapper { + min-height: 100vh; + margin-left: -15rem; + -webkit-transition: margin .25s ease-out; + -moz-transition: margin .25s ease-out; + -o-transition: margin .25s ease-out; + transition: margin .25s ease-out; +} + +.sidebar-wrapper .sidebar-heading { + padding: 0.875rem 1.25rem; + font-size: 1.2rem; +} + +.sidebar-wrapper .list-group { + width: 15rem; +} + +.page-content-wrapper { + width: 100vw; +} + +.wrapper.toggled .sidebar-wrapper { + margin-left: 0; +} + +@media (min-width: 768px) { + .sidebar-wrapper { + margin-left: 0; + } + + .page-content-wrapper { + min-width: 0; + width: 100%; + } + + .wrapper.toggled .sidebar-wrapper { + margin-left: -15rem; + } +} \ No newline at end of file diff --git a/templates/base.jinja2 b/templates/base.jinja2 index 0f2ec1e..fce6a98 100644 --- a/templates/base.jinja2 +++ b/templates/base.jinja2 @@ -49,12 +49,12 @@ {% block body %} -
-
{% block bottom_nav %}{% endblock %}
-
- {% block content %}{% endblock %} -
-
+ {#
#} + {#
{% block bottom_nav %}{% endblock %}
#} + {#
#} + {% block content %}{% endblock %} + {#
#} + {#
#} {% endblock %} {% block js_tail %}{% endblock %} diff --git a/templates/base_admin.jinja2 b/templates/base_admin.jinja2 new file mode 100644 index 0000000..88adf8e --- /dev/null +++ b/templates/base_admin.jinja2 @@ -0,0 +1,29 @@ +{% extends 'base.jinja2' %} + +{% block body %} +
+ + +
+
+ {% block admin_content %}{% endblock %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/macros/utils_macros.jinja2 b/templates/macros/utils_macros.jinja2 index 79f9be8..4604167 100644 --- a/templates/macros/utils_macros.jinja2 +++ b/templates/macros/utils_macros.jinja2 @@ -1,257 +1,24 @@ {# author: Marius Hofmann #} -{% macro format_money(float_value) -%} - {{ '{:10.2f} €'.format(float_value).replace('.', ',') }} -{% endmacro %} - -{% macro format_mass(float_value) -%} - {{ '{:10.2f} kg'.format(float_value).replace('.', ',') }} -{% endmacro %} - -{% macro format_distance(float_value) -%} - {{ '{:10.2f}m'.format(float_value).replace('.', ',') }} -{% endmacro %} - -{% macro get_item_default_image(item) -%} - {% if item.images.all()[0] %} - Item default image - {% else %} - - {% endif %} -{% endmacro %} - -{% macro get_item_shortened_desc(item) -%} - {% if item.description %} - {{ item.description|truncate(20, True, '...') }} - {% endif %} -{% endmacro %} - -{% macro get_item_image_ligthbox(item) -%} - {% if item.images.all()[0] %} - {# Used this https://lokeshdhakar.com/projects/lightbox2/ to realize the lightbox#} - -
-
- - Item default image - -
-
-
- {% for image in item.images.all() %} -
- - Bild - -
+{% macro get_sidebar(realms, realm=None) -%} + {#