From 73303bdd8fe1d72f80e08bbee3575ba3d68cae4b Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 5 Oct 2023 12:14:33 +0200 Subject: [PATCH] add admin template and buttons --- idhub/static/css/dashboard.css | 32 ++- idhub/templates/idhub/admin_dashboard.html | 140 +++++++++++++ idhub/templates/idhub/base.html | 2 +- idhub/templates/idhub/base_admin.html | 231 +++++++++++++++++++++ idhub/templates/idhub/user_dashboard.html | 12 +- idhub/urls.py | 1 + idhub/views.py | 3 + 7 files changed, 414 insertions(+), 7 deletions(-) create mode 100644 idhub/templates/idhub/admin_dashboard.html create mode 100644 idhub/templates/idhub/base_admin.html diff --git a/idhub/static/css/dashboard.css b/idhub/static/css/dashboard.css index 452547c..3aac76a 100644 --- a/idhub/static/css/dashboard.css +++ b/idhub/static/css/dashboard.css @@ -55,6 +55,10 @@ body { color: #9cc666; } +.sidebar .admin.nav-link.active { + color: #56beac; +} + .sidebar .nav-link:hover .feather, .sidebar .nav-link.active .feather { color: inherit; @@ -99,6 +103,9 @@ body { .bg-green { background-color: #9cc666; } +.admin.bg-green { + background-color: #56beac; +} .bg-grey { background-color: #545f71; @@ -126,7 +133,7 @@ body { } .ul_sidebar { - margin-left: 2rem; + margin-left: 2.5rem; } .sidebar .nav-link.active2 { @@ -136,4 +143,25 @@ body { h3 { font-sice: 1.2em; -} \ No newline at end of file +} + +.btn { + padding: 0.1em 2em; + font-weight: 700; +} + +.btn-green-admin { + background-color: #a3e3d7; +} + +.btn-grey { + background-color: #f3f3f3; +} + +.btn-green-user { + background-color: #c7e3a3; +} + +.btn-yellow { + background-color: #efe3b4; +} diff --git a/idhub/templates/idhub/admin_dashboard.html b/idhub/templates/idhub/admin_dashboard.html new file mode 100644 index 0000000..886430b --- /dev/null +++ b/idhub/templates/idhub/admin_dashboard.html @@ -0,0 +1,140 @@ +{% extends "idhub/base_admin.html" %} +{% load i18n %} + +{% block content %} +

+ + Identities (DID) +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#
1,001randomdataplaceholdertext
1,002placeholderirrelevantvisuallayout
1,003datarichdashboardtabular
1,003informationplaceholderillustrativedata
1,004textrandomlayoutdashboard
1,005dashboardirrelevanttextplaceholder
1,006dashboardillustrativerichdata
1,007placeholdertabularinformationirrelevant
1,008randomdataplaceholdertext
1,009placeholderirrelevantvisuallayout
1,010datarichdashboardtabular
1,011informationplaceholderillustrativedata
1,012textplaceholderlayoutdashboard
1,013dashboardirrelevanttextvisual
1,014dashboardillustrativerichdata
1,015randomtabularinformationtext
+
+
+
+
+
+{% endblock %} diff --git a/idhub/templates/idhub/base.html b/idhub/templates/idhub/base.html index f6dcfb4..16e20a7 100644 --- a/idhub/templates/idhub/base.html +++ b/idhub/templates/idhub/base.html @@ -137,7 +137,7 @@ {% endfor %} {% endblock messages %}
-

{{ title }}

+

{{ title }}

diff --git a/idhub/templates/idhub/base_admin.html b/idhub/templates/idhub/base_admin.html new file mode 100644 index 0000000..e4872d8 --- /dev/null +++ b/idhub/templates/idhub/base_admin.html @@ -0,0 +1,231 @@ +{% load i18n static %} + + + + + {% block head %} + {% block meta %} + + + + + + {% endblock %} + {% block title %}{% if title %}{{ title }} – {% endif %}IdHub{% endblock %} + + + {% block style %} + + + + + + + + + + {% endblock %} + {% endblock %} + + + + +
+
+ + +
+ {% block messages %} + {% for message in messages %} + + {% endfor %} + {% endblock messages %} +
+

{{ title }}

+
+
+ +
+
+
+ + {% block content %} + {% endblock content %} + +
+
+
+ + + + + + + diff --git a/idhub/templates/idhub/user_dashboard.html b/idhub/templates/idhub/user_dashboard.html index 08c847f..e124a3d 100644 --- a/idhub/templates/idhub/user_dashboard.html +++ b/idhub/templates/idhub/user_dashboard.html @@ -11,10 +11,10 @@ # - Header - Header - Header - Header + + + + @@ -133,4 +133,8 @@
+
+
+
+
{% endblock %} diff --git a/idhub/urls.py b/idhub/urls.py index 27fd270..f9e1158 100644 --- a/idhub/urls.py +++ b/idhub/urls.py @@ -25,4 +25,5 @@ urlpatterns = [ # path("", views.index, name="index"), path('login/', views.LoginView.as_view(), name='login'), path('user/dashboard/', views.UserDashboardView.as_view(), name='user_dashboard'), + path('admin/dashboard/', views.AdminDashboardView.as_view(), name='user_dashboard'), ] diff --git a/idhub/views.py b/idhub/views.py index 5af9fc5..2ba5524 100644 --- a/idhub/views.py +++ b/idhub/views.py @@ -38,6 +38,9 @@ class UserDashboardView(TemplateView): return context +class AdminDashboardView(UserDashboardView): + template_name = "idhub/admin_dashboard.html" + class LoginView(FormView): template_name = 'auth/login.html'