diff --git a/musician/templates/musician/addresses.html b/musician/templates/musician/addresses.html
new file mode 100644
index 0000000..3c2e6f5
--- /dev/null
+++ b/musician/templates/musician/addresses.html
@@ -0,0 +1,42 @@
+{% extends "musician/mail_base.html" %}
+{% load i18n %}
+
+{% block tabcontent %}
+
+ {% block tabcontent %}
+ {% endblock %}
+
+{% endblock %}
diff --git a/musician/templates/musician/mailboxes.html b/musician/templates/musician/mailboxes.html
new file mode 100644
index 0000000..2c731b5
--- /dev/null
+++ b/musician/templates/musician/mailboxes.html
@@ -0,0 +1,34 @@
+{% extends "musician/mail_base.html" %}
+{% load i18n %}
+
+{% block tabcontent %}
+
+
+
+
+
+
+
+
+
+
+ {% trans "Name" %} |
+ {% trans "Filtering" %} |
+ {% trans "Addresses" %} |
+ {% trans "Active" %} |
+
+
+
+ {% for mailbox in mailboxes %}
+
+ {{ mailbox.name }} |
+ {{ mailbox.filtering }} |
+ {{ mailbox.addresses }} |
+ |
+
+ {% endfor %}
+
+ {% include "musician/components/table_paginator.html" %}
+
+
+{% endblock %}
diff --git a/musician/urls.py b/musician/urls.py
index ae2676b..d699832 100644
--- a/musician/urls.py
+++ b/musician/urls.py
@@ -22,6 +22,7 @@ urlpatterns = [
path('mails/', views.MailView.as_view(), name='mails'),
path('mails/new/', views.MailCreateView.as_view(), name='mail-create'),
path('mails//', views.MailUpdateView.as_view(), name='mail-update'),
+ path('mailboxes/', views.MailboxesView.as_view(), name='mailboxes'),
path('mailing-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'),
diff --git a/musician/views.py b/musician/views.py
index bd147a4..412f0e5 100644
--- a/musician/views.py
+++ b/musician/views.py
@@ -170,7 +170,7 @@ class BillDownloadView(CustomContextMixin, UserTokenRequiredMixin, View):
class MailView(ServiceListView):
service_class = Address
- template_name = "musician/mail.html"
+ template_name = "musician/addresses.html"
extra_context = {
# Translators: This message appears on the page title
'title': _('Mail addresses'),
@@ -199,6 +199,7 @@ class MailView(ServiceListView):
context.update({
'active_domain': self.orchestra.retrieve_domain(domain_id)
})
+ context['mailboxes'] = self.orchestra.retrieve_mailbox_list()
return context
@@ -287,6 +288,26 @@ class MailingListsView(ServiceListView):
return ''
+class MailboxesView(ServiceListView):
+ # TODO (@slamora) refactor after encapsulating Mailbox as a service
+ # service_class = Mailbox
+ template_name = "musician/mailboxes.html"
+ extra_context = {
+ # Translators: This message appears on the page title
+ 'title': _('Mailboxes'),
+ }
+
+ def get_queryset(self):
+ # TODO (@slamora) refactor after encapsulating Mailbox as a service
+ return self.orchestra.retrieve_mailbox_list()
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ # TODO (@slamora) refactor after encapsulating Mailbox as a service
+ context['mailboxes'] = context['object_list']
+ return context
+
+
class DatabasesView(ServiceListView):
template_name = "musician/databases.html"
service_class = DatabaseService