From 7cbcdc62ae0d55f0638bf83fca331ed4fb107828 Mon Sep 17 00:00:00 2001 From: mipel Date: Wed, 7 Jul 2021 13:46:33 +0200 Subject: [PATCH] Dashboard * finishes work on dashboard --- konova/static/css/konova.css | 32 +++++++ konova/templates/konova/home.html | 109 ++++++++++++++++++++++-- konova/views.py | 6 ++ news/templates/news/dashboard-news.html | 5 +- 4 files changed, 145 insertions(+), 7 deletions(-) diff --git a/konova/static/css/konova.css b/konova/static/css/konova.css index 341d5e2..9f551ed 100644 --- a/konova/static/css/konova.css +++ b/konova/static/css/konova.css @@ -7,6 +7,21 @@ Declare some basic colours --rlp-gray-light: #c6c6c6; } +.rlp-gl{ + background-color: var(--rlp-gray-light); + color:white; +} + +.rlp-gd{ + background-color: var(--rlp-gray-dark); + color:white; +} + +.rlp-r{ + background-color: var(--rlp-red); + color:white; +} + html { position: relative; min-height: 100%; @@ -81,4 +96,21 @@ nav{ font-size: 12px; max-height: 150px; overflow: auto; +} + +.qs-box{ + background-color: var(--rlp-red); + color: white; + font-size: 3rem; + width: 8rem; + height: 8rem; +} + +.btn-default{ + color: white; + background-color: var(--rlp-red); + border-radius: 0; +} +.btn-default:hover{ + color: var(--rlp-gray-light); } \ No newline at end of file diff --git a/konova/templates/konova/home.html b/konova/templates/konova/home.html index 26dffba..ff8a537 100644 --- a/konova/templates/konova/home.html +++ b/konova/templates/konova/home.html @@ -1,15 +1,114 @@ {% extends 'base.html' %} -{% load i18n %} +{% load i18n fontawesome_5 %} {% block body %} {% include 'news/dashboard-news.html' %}
-

{% trans 'Quickstart' %}

-
{% trans 'Intervention' %}
-
{% trans 'Compensation' %}
-
{% trans 'Eco-account' %}
+
+

+ {% trans 'Intervention' %} +

+
+
+
+ {% fa5_icon 'pencil-ruler' %} +
+
+
+
+
{% trans 'Total' %}
+
{{total_intervention_count}}
+
+
+
{% trans 'Your own' %}
+
{{user_intervention_count}}
+
+
+
+ +
+
+

+ {% trans 'Compensation' %} +

+
+
+
+ {% fa5_icon 'leaf' %} +
+
+
+
+
{% trans 'Total' %}
+
{{total_compensation_count}}
+
+
+
{% trans 'Your own' %}
+
{{user_compensation_count}}
+
+
+
+ +
+ +
+

+ {% trans 'Eco-account' %} +

+
+
+
+ {% fa5_icon 'tree' %} +
+
+
+
+
{% trans 'Total' %}
+
{{total_eco_count}}
+
+
+
{% trans 'Your own' %}
+
{{user_eco_count}}
+
+
+
+ +
diff --git a/konova/views.py b/konova/views.py index 5d47a1c..8c85d28 100644 --- a/konova/views.py +++ b/konova/views.py @@ -54,6 +54,12 @@ def home_view(request: HttpRequest): additional_context = { "msgs": msgs, + "total_intervention_count": 123, + "user_intervention_count": 5, + "total_compensation_count": 123, + "user_compensation_count": 5, + "total_eco_count": 123, + "user_eco_count": 5, } context = BaseContext(request, additional_context).context return render(request, template, context) diff --git a/news/templates/news/dashboard-news.html b/news/templates/news/dashboard-news.html index eb6df5a..dc7686b 100644 --- a/news/templates/news/dashboard-news.html +++ b/news/templates/news/dashboard-news.html @@ -1,12 +1,13 @@ {% load i18n ksp_filters %}
-

{% trans 'News' %}

{% for msg in msgs %}
-
{{msg.subject}}
+
+ {{msg.subject}} +
{% trans 'Published on' %} {{msg.publish_on}}
{{msg.body|safe}}