From 866f6c8083e758ff9e4795f92d9d15660d0eada9 Mon Sep 17 00:00:00 2001
From: Jan Dittberner
- {% if user == customer %}{% translate "You have no hosting packages setup yet." %}{% else %}
- {% translate "There are no hosting packages setup for this customer yet." %}{% endif %} {% translate "Add hosting package" %} {% translate 'The following e-mail addresses are associated with your account:' %} {% 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." %} {% translate 'The following e-mail addresses are associated with your account:' %}
+ {% 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." %}
+
{% for package in hosting_packages %}
{% translate "Name" %}
- {% translate "Disk space" %}
- {% translate "Mailboxes" %}
- {% translate "Databases" %}
+ {% translate "Setup date" %}
{% translate "Actions" %}
-
{% 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 @@
{{ package.name }}
-
-
- {% with diskspace=package.get_disk_space %}
- {{ diskspace|filesizeformat }}
- {% endwith %}
-
-
- {% 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 }}
+
{% translate "Name" %}
{% translate "Customer" %}
{% translate "OS User" %}
+ {% translate "Disk space" %}
+ {% translate "Mailboxes" %}
+ {% translate "Databases" %}
{% translate "Setup date" %}
@@ -21,6 +24,22 @@
{{ package.customer }}
+
+ {% with diskspace=package.get_disk_space %}
+ {{ diskspace|filesizeformat }}
+ {% endwith %}
+
+
+ {% 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.osuser.username }}
{{ package.created }}
diff --git a/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_list.html b/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_list.html
deleted file mode 100644
index 940b2b4..0000000
--- a/gnuviechadmin/hostingpackages/templates/hostingpackages/customerhostingpackage_list.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{% extends "hostingpackages/base.html" %}
-{% load i18n %}
-{% block title %}{{ block.super }} - {% spaceless %}
- {% if user == customer %}
- {% translate "Your hosting packages" %}
- {% else %}
- {% blocktranslate with customer=customer.get_full_name trimmed %}Hosting Packages of
- {{ customer }}{% endblocktranslate %}
- {% endif %}
-{% endspaceless %}{% endblock title %}
-
-{% block page_title %}{% spaceless %}
- {% if user == customer %}
- {% translate "Your hosting packages" %}
- {% else %}
- {% blocktranslate with customer=customer.get_full_name trimmed %}Hosting Packages
- of {{ customer }}{% endblocktranslate %}
- {% endif %}
-{% endspaceless %}{% endblock page_title %}
-
-{% block content %}
- {% if customerhostingpackage_list %}
-
-
-
- {% else %}
-
-
-
-
- {% for package in customerhostingpackage_list %}
- {% translate "Name" %}
- {% translate "Setup date" %}
-
-
- {% endfor %}
-
- {{ package.name }}
- {{ package.created }}
- {% translate "Add E-mail Address" %}
+ {% translate "Add E-mail Address" %}
-
+
{% endblock content %}
{% block extra_js %}
-
+
{% endblock extra_js %}
diff --git a/gnuviechadmin/templates/account/email_confirm.html b/gnuviechadmin/templates/account/email_confirm.html
index c91da96..e70246c 100644
--- a/gnuviechadmin/templates/account/email_confirm.html
+++ b/gnuviechadmin/templates/account/email_confirm.html
@@ -11,7 +11,7 @@
{% endblocktranslate %}