- {% blocktranslate with num=package.used_mailbox_count total=package.mailbox_count trimmed %}
- used {{ num }} of {{ total }}
- {% endblocktranslate %}
-
{% for dbtype in package.get_databases %}
- {{ dbtype.number }}
- {% include "userdbs/snippets/db_type.html" with db_type=dbtype.db_type %}
- {% if not forloop.last %} / {% endif %}
- {% endfor %}
-
+
+
{{ package.created }}
+
{% endfor %}
diff --git a/gnuviechadmin/dashboard/views.py b/gnuviechadmin/dashboard/views.py
index 7f30316..2ed2558 100644
--- a/gnuviechadmin/dashboard/views.py
+++ b/gnuviechadmin/dashboard/views.py
@@ -4,6 +4,7 @@ This module defines the views for the gnuviechadmin customer dashboard.
"""
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
+from django.shortcuts import redirect
from django.views.generic import DetailView, TemplateView
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
@@ -18,6 +19,11 @@ class IndexView(LoginRequiredMixin, TemplateView):
template_name = "dashboard/index.html"
+ def dispatch(self, request, *args, **kwargs):
+ if not request.user.is_anonymous:
+ return redirect("customer_dashboard", slug=request.user.username)
+ return super().dispatch(request, *args, **kwargs)
+
class UserDashboardView(StaffOrSelfLoginRequiredMixin, DetailView):
"""
diff --git a/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html b/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html
index a4b7727..982f700 100644
--- a/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html
+++ b/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_admin_list.html
@@ -11,6 +11,9 @@
+ {% blocktranslate with num=package.used_mailbox_count total=package.mailbox_count trimmed %}
+ used {{ num }} of {{ total }}
+ {% endblocktranslate %}
+
{% for dbtype in package.get_databases %}
+ {{ dbtype.number }}
+ {% include "userdbs/snippets/db_type.html" with db_type=dbtype.db_type %}
+ {% if not forloop.last %} / {% endif %}
+ {% endfor %}
- {% if user == customer %}{% translate "You have no hosting packages setup yet." %}{% else %}
- {% translate "There are no hosting packages setup for this customer yet." %}{% endif %}
- {% endif %}
-{% endblock content %}
diff --git a/gnuviechadmin/hostingpackages/urls.py b/gnuviechadmin/hostingpackages/urls.py
index 9f1dfb7..fe3faa6 100644
--- a/gnuviechadmin/hostingpackages/urls.py
+++ b/gnuviechadmin/hostingpackages/urls.py
@@ -12,7 +12,6 @@ from .views import (
CreateCustomerHostingPackage,
CreateHostingPackage,
CustomerHostingPackageDetails,
- CustomerHostingPackageList,
HostingOptionChoices,
)
@@ -23,11 +22,6 @@ urlpatterns = [
AllCustomerHostingPackageList.as_view(),
name="all_hosting_packages",
),
- re_path(
- r"^(?P[-\w0-9@.+_]+)/$",
- CustomerHostingPackageList.as_view(),
- name="hosting_packages",
- ),
re_path(
r"^(?P[-\w0-9@.+_]+)/create$",
CreateCustomerHostingPackage.as_view(),
diff --git a/gnuviechadmin/hostingpackages/views.py b/gnuviechadmin/hostingpackages/views.py
index d94f296..37ff280 100644
--- a/gnuviechadmin/hostingpackages/views.py
+++ b/gnuviechadmin/hostingpackages/views.py
@@ -149,35 +149,6 @@ class AllCustomerHostingPackageList(StaffUserRequiredMixin, ListView):
)
-class CustomerHostingPackageList(StaffOrSelfLoginRequiredMixin, ListView):
- """
- This view is used for showing a list of a customer's hosting packages.
-
- """
-
- model = CustomerHostingPackage
- customer = None
-
- def get_customer_object(self):
- if self.customer is None:
- self.customer = get_object_or_404(
- get_user_model(), username=self.kwargs["user"]
- )
- return self.customer
-
- def get_context_data(self, **kwargs):
- context = super(CustomerHostingPackageList, self).get_context_data(**kwargs)
- context["customer"] = self.get_customer_object()
- return context
-
- def get_queryset(self):
- return (
- super(CustomerHostingPackageList, self)
- .get_queryset()
- .filter(customer__username=self.kwargs["user"])
- )
-
-
class HostingOptionChoices(StaffUserRequiredMixin, DetailView):
"""
This view displays choices of hosting options for a customer hosting
diff --git a/gnuviechadmin/templates/account/email.html b/gnuviechadmin/templates/account/email.html
index fc66cf3..23a15cd 100644
--- a/gnuviechadmin/templates/account/email.html
+++ b/gnuviechadmin/templates/account/email.html
@@ -4,72 +4,87 @@
{% block page_title %}{% translate "E-mail Addresses" %}{% endblock page_title %}
{% block content %}
-{% if user.emailaddress_set.all %}
-
{% translate 'The following e-mail addresses are associated with your account:' %}
-
-{% else %}
-
{% translate 'Warning:'%} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
-{% endif %}
+ {% if user.emailaddress_set.all %}
+
{% translate 'The following e-mail addresses are associated with your account:' %}
+
+ {% else %}
+
+ {% translate 'Warning:' %} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
+