From 8a2d409e321d3b44a9c9d1efc06cc443eb2aff82 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Wed, 20 Nov 2019 17:25:32 +0100 Subject: [PATCH] Code mail component. --- musician/templates/musician/mail.html | 26 +++++++++++++++++++++++--- musician/views.py | 3 ++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/musician/templates/musician/mail.html b/musician/templates/musician/mail.html index 927ff1c..116fae4 100644 --- a/musician/templates/musician/mail.html +++ b/musician/templates/musician/mail.html @@ -3,7 +3,27 @@ {% block content %} -

Section title

-

Little description of what to be expected...

- +

{{ service.verbose_name }}

+

{{ service.description }}

+ + + + + + + + + + + {% for obj in object_list %} + + + + + + + {% endfor %} + + {% include "musician/components/table_paginator.html" %} +
Mail addressTypeType details
{{ obj.mail_address }}{{ obj.aliases|join:" , " }}{{ obj.type }}{{ obj.type_detail }}
{% endblock %} diff --git a/musician/views.py b/musician/views.py index f794351..071f9ed 100644 --- a/musician/views.py +++ b/musician/views.py @@ -57,6 +57,7 @@ class ServiceListView(CustomContextMixin, ExtendedPaginationMixin, UserTokenRequ class MailView(ServiceListView): service_class = MailService + template_name = "musician/mail.html" def get_queryset(self): def retrieve_mailbox(value): @@ -79,7 +80,7 @@ class MailView(ServiceListView): data = thing data['names'] = aliases - addresses.append(self.service_class(data)) + addresses.append(self.service_class.new_from_json(data)) return addresses