From a3cbede680f9623c7ab4071df9abf143dec64065 Mon Sep 17 00:00:00 2001 From: Jocelyn Delalande Date: Wed, 1 Feb 2017 20:22:25 +0100 Subject: [PATCH] Refactor layout based on bootstrap 4 grid --- budget/static/css/main.css | 17 ++++++--------- budget/templates/home.html | 24 ++++++++-------------- budget/templates/layout.html | 15 +++++++------- budget/templates/list_bills.html | 12 +---------- budget/templates/settle_bills.html | 6 +----- budget/templates/sidebar_table_layout.html | 14 +++++++++++++ 6 files changed, 39 insertions(+), 49 deletions(-) create mode 100644 budget/templates/sidebar_table_layout.html diff --git a/budget/static/css/main.css b/budget/static/css/main.css index f3fe8a0..0a07e94 100644 --- a/budget/static/css/main.css +++ b/budget/static/css/main.css @@ -55,13 +55,6 @@ body { background-position: center bottom; background-repeat: no-repeat; height: 100%; - width: 230px; - padding-left: 10px; - padding-right: 20px; - padding-top: 10px; - margin-left: -20px; - margin-top: -10px; - margin-right: 15px; color: black; position: fixed; } @@ -70,13 +63,13 @@ body { #add-member-form input[type="text"] { width: 60%; } #add-member-form button { width: 35%; } -#table_overflow { overflow-y: auto; overflow-x: hidden; width: 235px; } +#table_overflow { overflow-y: auto; overflow-x: hidden;} + /* Content */ .content { - padding-top: 1em; - padding-left: 250px; + margin-top: 1rem; } /* Home */ @@ -94,7 +87,9 @@ body { height: 100px; } -#footer{ +footer{ + margin-left: -15px; + margin-right: -15px; margin-top: 30px; position: fixed; bottom: 0px; diff --git a/budget/templates/home.html b/budget/templates/home.html index e6d7932..d970fe7 100644 --- a/budget/templates/home.html +++ b/budget/templates/home.html @@ -1,24 +1,19 @@ {% extends "layout.html" %} -{% block header %} - -{% block header %}{% endblock %} -{% block body %} + +
+{% block body %} {% block sidebar %}{% endblock %} -
+
{% block content %}{% endblock %} -
+
{% endblock %} {% for message in get_flashed_messages() %} -

{{ message }}

+
{{ message }}
{% endfor %} {% block footer %} - + {% endblock %} diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index aacc128..69a1692 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -1,16 +1,10 @@ -{% extends "layout.html" %} +{% extends "sidebar_table_layout.html" %} {% block title %} - {{ g.project.name }}{% endblock %} {% block head %} {% endblock %} {% block js %} - - $(window).resize(function() { - $("#sidebar").height( window.innerHeight-50 ); - $("#table_overflow").height( $("#sidebar").height()-120 ); - }); - {% if add_bill %} $('#new-bill').click(); {% endif %} // Hide all members actions @@ -56,8 +50,6 @@ {% endblock %} {% block sidebar %} - - - {% endblock %} {% block content %} diff --git a/budget/templates/settle_bills.html b/budget/templates/settle_bills.html index 8a9f733..b67a9b8 100644 --- a/budget/templates/settle_bills.html +++ b/budget/templates/settle_bills.html @@ -1,8 +1,6 @@ -{% extends "layout.html" %} +{% extends "sidebar_table_layout.html" %} {% block sidebar %} - {% endblock %} diff --git a/budget/templates/sidebar_table_layout.html b/budget/templates/sidebar_table_layout.html new file mode 100644 index 0000000..7c831f4 --- /dev/null +++ b/budget/templates/sidebar_table_layout.html @@ -0,0 +1,14 @@ +{% extends "layout.html" %} + +{% block body %} +
+ + +
+ {% block content %}{% endblock %} +
+ +
+{% endblock %}