From 98dfa7a9f41eff60f282ca1f05f39ed9b282acf8 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Mon, 27 Sep 2021 13:52:27 +0200 Subject: [PATCH] Make URLs patterns homogeneus --- musician/mixins.py | 6 +++--- musician/templates/musician/addresses.html | 4 ++-- musician/templates/musician/dashboard.html | 4 ++-- musician/templates/musician/mail_base.html | 9 +++++---- musician/templates/musician/mail_form.html | 2 +- musician/templates/musician/mailboxes.html | 2 +- musician/urls.py | 14 +++++++------- musician/views.py | 4 ++-- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/musician/mixins.py b/musician/mixins.py index 3cc463a..ba54587 100644 --- a/musician/mixins.py +++ b/musician/mixins.py @@ -12,10 +12,10 @@ class CustomContextMixin(ContextMixin): # generate services menu items services_menu = [ {'icon': 'globe-europe', 'pattern_name': 'musician:dashboard', 'title': _('Domains & websites')}, - {'icon': 'envelope', 'pattern_name': 'musician:mails', 'title': _('Mails')}, + {'icon': 'envelope', 'pattern_name': 'musician:address-list', 'title': _('Mails')}, {'icon': 'mail-bulk', 'pattern_name': 'musician:mailing-lists', 'title': _('Mailing lists')}, - {'icon': 'database', 'pattern_name': 'musician:databases', 'title': _('Databases')}, - {'icon': 'fire', 'pattern_name': 'musician:saas', 'title': _('SaaS')}, + {'icon': 'database', 'pattern_name': 'musician:database-list', 'title': _('Databases')}, + {'icon': 'fire', 'pattern_name': 'musician:saas-list', 'title': _('SaaS')}, ] context.update({ 'services_menu': services_menu, diff --git a/musician/templates/musician/addresses.html b/musician/templates/musician/addresses.html index 5c0c757..4f6bf5c 100644 --- a/musician/templates/musician/addresses.html +++ b/musician/templates/musician/addresses.html @@ -21,7 +21,7 @@ {% for obj in object_list %} - {{ obj.mail_address }} + {{ obj.mail_address }} {{ obj.domain.name }} {% for mailbox in obj.mailboxes %} @@ -34,7 +34,7 @@ {% include "musician/components/table_paginator.html" %} - {% trans "New mail address" %} + {% trans "New mail address" %} {% endblock %} diff --git a/musician/templates/musician/dashboard.html b/musician/templates/musician/dashboard.html index addca3d..8226bd1 100644 --- a/musician/templates/musician/dashboard.html +++ b/musician/templates/musician/dashboard.html @@ -71,7 +71,7 @@ {{ domain.addresses_left.count }} {% trans "mail address left" %} {% endif %}

- +

{% trans "Mail list" %}

@@ -82,7 +82,7 @@

{% trans "Software as a Service" %}

{% trans "Nothing installed" %}

- +
diff --git a/musician/templates/musician/mail_base.html b/musician/templates/musician/mail_base.html index 1790e90..4d15891 100644 --- a/musician/templates/musician/mail_base.html +++ b/musician/templates/musician/mail_base.html @@ -3,7 +3,7 @@ {% block content %} {% if active_domain %} -{% trans "Go to global" %} +{% trans "Go to global" %} {% endif %}

{{ service.verbose_name }}{% if active_domain %} {% trans "for" @@ -13,11 +13,12 @@ {% with request.resolver_match.url_name as url_name %} diff --git a/musician/templates/musician/mail_form.html b/musician/templates/musician/mail_form.html index c6bb3ec..2f0aa07 100644 --- a/musician/templates/musician/mail_form.html +++ b/musician/templates/musician/mail_form.html @@ -8,7 +8,7 @@ {% csrf_token %} {% bootstrap_form form %} {% buttons %} - {% trans "Cancel" %} + {% trans "Cancel" %} {% endbuttons %} diff --git a/musician/templates/musician/mailboxes.html b/musician/templates/musician/mailboxes.html index a9e0764..666c94b 100644 --- a/musician/templates/musician/mailboxes.html +++ b/musician/templates/musician/mailboxes.html @@ -25,7 +25,7 @@ {{ mailbox.filtering }} {% for addr in mailbox.addresses %} - + {{ addr.data.name }}@{{ addr.data.domain.name }}
{% endfor %} diff --git a/musician/urls.py b/musician/urls.py index d699832..308bf06 100644 --- a/musician/urls.py +++ b/musician/urls.py @@ -16,14 +16,14 @@ urlpatterns = [ path('auth/logout/', views.LogoutView.as_view(), name='logout'), path('dashboard/', views.DashboardView.as_view(), name='dashboard'), path('domains//', views.DomainDetailView.as_view(), name='domain-detail'), - path('bills/', views.BillingView.as_view(), name='billing'), + path('billing/', views.BillingView.as_view(), name='billing'), path('bills//download/', views.BillDownloadView.as_view(), name='bill-download'), path('profile/', views.ProfileView.as_view(), name='profile'), - 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('address/', views.MailView.as_view(), name='address-list'), + path('address/new/', views.MailCreateView.as_view(), name='address-create'), + path('address//', views.MailUpdateView.as_view(), name='address-update'), + path('mailboxes/', views.MailboxesView.as_view(), name='mailbox-list'), 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'), + path('databases/', views.DatabasesView.as_view(), name='database-list'), + path('saas/', views.SaasView.as_view(), name='saas-list'), ] diff --git a/musician/views.py b/musician/views.py index 336f4ea..4e524ac 100644 --- a/musician/views.py +++ b/musician/views.py @@ -207,7 +207,7 @@ class MailCreateView(CustomContextMixin, UserTokenRequiredMixin, FormView): service_class = Address template_name = "musician/mail_form.html" form_class = MailForm - success_url = reverse_lazy("musician:mails") + success_url = reverse_lazy("musician:address-list") extra_context = {'service': service_class} def get_form_kwargs(self): @@ -232,7 +232,7 @@ class MailUpdateView(CustomContextMixin, UserTokenRequiredMixin, FormView): service_class = Address template_name = "musician/mail_form.html" form_class = MailForm - success_url = reverse_lazy("musician:mails") + success_url = reverse_lazy("musician:address-list") extra_context = {'service': service_class} def get_form_kwargs(self):