Code mail component.

This commit is contained in:
Santiago Lamora 2019-11-20 17:25:32 +01:00
parent 5322f62cdf
commit 8a2d409e32
2 changed files with 25 additions and 4 deletions

View File

@ -3,7 +3,27 @@
{% block content %}
<h1>Section title</h1>
<p>Little description of what to be expected...</p>
<h1>{{ service.verbose_name }}</h1>
<p>{{ service.description }}</p>
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">Mail address</th>
<th scope="col"></th>
<th scope="col">Type</th>
<th scope="col">Type details</th>
</tr>
</thead>
<tbody>
{% for obj in object_list %}
<tr>
<td>{{ obj.mail_address }}</td>
<td>{{ obj.aliases|join:" , " }}</td>
<td>{{ obj.type }}</td>
<td>{{ obj.type_detail }}</td>
</tr>
{% endfor %}
</tbody>
{% include "musician/components/table_paginator.html" %}
</table>
{% endblock %}

View File

@ -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