From 8875e160f2c18ba61dc25d1a6303ba8b31b70a99 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Wed, 30 Oct 2019 14:35:30 +0100 Subject: [PATCH 1/3] Create base views to all the services. --- musician/templates/musician/databases.html | 9 +++++++++ musician/templates/musician/mail.html | 9 +++++++++ musician/templates/musician/mailinglists.html | 9 +++++++++ musician/templates/musician/saas.html | 9 +++++++++ musician/urls.py | 4 ++++ 5 files changed, 40 insertions(+) create mode 100644 musician/templates/musician/databases.html create mode 100644 musician/templates/musician/mail.html create mode 100644 musician/templates/musician/mailinglists.html create mode 100644 musician/templates/musician/saas.html diff --git a/musician/templates/musician/databases.html b/musician/templates/musician/databases.html new file mode 100644 index 0000000..927ff1c --- /dev/null +++ b/musician/templates/musician/databases.html @@ -0,0 +1,9 @@ +{% extends "musician/base.html" %} +{% load i18n %} + +{% block content %} + +

Section title

+

Little description of what to be expected...

+ +{% endblock %} diff --git a/musician/templates/musician/mail.html b/musician/templates/musician/mail.html new file mode 100644 index 0000000..927ff1c --- /dev/null +++ b/musician/templates/musician/mail.html @@ -0,0 +1,9 @@ +{% extends "musician/base.html" %} +{% load i18n %} + +{% block content %} + +

Section title

+

Little description of what to be expected...

+ +{% endblock %} diff --git a/musician/templates/musician/mailinglists.html b/musician/templates/musician/mailinglists.html new file mode 100644 index 0000000..927ff1c --- /dev/null +++ b/musician/templates/musician/mailinglists.html @@ -0,0 +1,9 @@ +{% extends "musician/base.html" %} +{% load i18n %} + +{% block content %} + +

Section title

+

Little description of what to be expected...

+ +{% endblock %} diff --git a/musician/templates/musician/saas.html b/musician/templates/musician/saas.html new file mode 100644 index 0000000..927ff1c --- /dev/null +++ b/musician/templates/musician/saas.html @@ -0,0 +1,9 @@ +{% extends "musician/base.html" %} +{% load i18n %} + +{% block content %} + +

Section title

+

Little description of what to be expected...

+ +{% endblock %} diff --git a/musician/urls.py b/musician/urls.py index 8e8ff38..08dfd8b 100644 --- a/musician/urls.py +++ b/musician/urls.py @@ -15,4 +15,8 @@ urlpatterns = [ path('auth/login/', views.LoginView.as_view(), name='login'), path('auth/logout/', views.LogoutView.as_view(), name='logout'), path('dashboard/', views.DashboardView.as_view(), name='dashboard'), + path('mails/', views.MailView.as_view(), name='mails'), + path('maling-lists/', views.MailingListsView.as_view(), name='mailing-lists'), + path('databases/', views.DatabasesView.as_view(), name='databases'), + path('software-as-a-service/', views.SaasView.as_view(), name='saas'), ] From 2e283cd39ea63fb9120f6b71903751450946314a Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Wed, 30 Oct 2019 14:36:03 +0100 Subject: [PATCH 2/3] Complete navbar with link to the services. --- musician/mixins.py | 12 ++++++++++-- musician/templates/musician/base.html | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/musician/mixins.py b/musician/mixins.py index 3b6b0bf..cf58bff 100644 --- a/musician/mixins.py +++ b/musician/mixins.py @@ -1,15 +1,23 @@ from django.contrib.auth.mixins import UserPassesTestMixin from django.views.generic.base import ContextMixin -from . import get_version +from . import api, get_version from .auth import SESSION_KEY_TOKEN class CustomContextMixin(ContextMixin): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - # TODO generate menu items + # generate services menu items + services_menu = [ + {'pattern_name': 'musician:dashboard', 'title': 'Domains & websites'}, + {'pattern_name': 'musician:mails', 'title': 'Mails'}, + {'pattern_name': 'musician:mailing-lists', 'title': 'Mailing lists'}, + {'pattern_name': 'musician:databases', 'title': 'Databases'}, + {'pattern_name': 'musician:saas', 'title': 'SaaS'}, + ] context.update({ + 'services_menu': services_menu, 'version': get_version(), }) diff --git a/musician/templates/musician/base.html b/musician/templates/musician/base.html index 8e1eb35..db5445c 100644 --- a/musician/templates/musician/base.html +++ b/musician/templates/musician/base.html @@ -38,11 +38,13 @@

{{ version }}

{# #} + {% for item in services_menu %} + {% endfor %} {# #}