From 0bd49c04c4355a41b66a9e7ab68d3008c910cea5 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Fri, 6 Dec 2019 10:28:34 +0100 Subject: [PATCH] Create and code styles of saas view. --- musician/static/musician/css/default.css | 4 +++ musician/templates/musician/saas.html | 38 ++++++++++++++++++++++-- musician/views.py | 12 ++++---- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/musician/static/musician/css/default.css b/musician/static/musician/css/default.css index 3494b81..23bd5b1 100644 --- a/musician/static/musician/css/default.css +++ b/musician/static/musician/css/default.css @@ -168,3 +168,7 @@ h1.service-name { .service-card .service-manager-link a i.fas { color: white; } + +.service-card .card-body .service-brand i.fab { + color: #9C9AA7; +} diff --git a/musician/templates/musician/saas.html b/musician/templates/musician/saas.html index 927ff1c..eaad20a 100644 --- a/musician/templates/musician/saas.html +++ b/musician/templates/musician/saas.html @@ -3,7 +3,41 @@ {% block content %} -

Section title

-

Little description of what to be expected...

+

{{ service.verbose_name }}

+

{{ service.description }}

+ +{% for saas in object_list %} +
+
+
+
+ {{ saas.name }} +
+
+ {% trans "Installed on" %}: {{ saas.domain|default:"-" }} +
+
+
+
+
+

{{ saas.service|capfirst }}

+

+
+
+

{% trans "Service info" %}

+

{% trans "Active" %}: {{ saas.is_active|yesno }}

+ {# TODO (@slamora): implement saas details #} +
+                {{ saas.data }}
+            
+
+ +
+
+{% endfor %} {% endblock %} diff --git a/musician/views.py b/musician/views.py index 993ca01..5d7e68a 100644 --- a/musician/views.py +++ b/musician/views.py @@ -1,5 +1,4 @@ -from django.views.generic.detail import DetailView from itertools import groupby from django.core.exceptions import ImproperlyConfigured @@ -8,6 +7,7 @@ from django.shortcuts import render from django.urls import reverse_lazy from django.utils.http import is_safe_url from django.views.generic.base import RedirectView, TemplateView +from django.views.generic.detail import DetailView from django.views.generic.edit import FormView from django.views.generic.list import ListView @@ -15,9 +15,10 @@ from . import api, get_version from .auth import login as auth_login from .auth import logout as auth_logout from .forms import LoginForm -from .mixins import (CustomContextMixin, - ExtendedPaginationMixin, UserTokenRequiredMixin) -from .models import DatabaseService, MailinglistService, MailService, UserAccount, PaymentSource +from .mixins import (CustomContextMixin, ExtendedPaginationMixin, + UserTokenRequiredMixin) +from .models import (DatabaseService, MailinglistService, MailService, + PaymentSource, SaasService, UserAccount) class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): @@ -135,7 +136,8 @@ class DatabasesView(ServiceListView): service_class = DatabaseService -class SaasView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): +class SaasView(ServiceListView): + service_class = SaasService template_name = "musician/saas.html"