diff --git a/docs/changelog.rst b/docs/changelog.rst index 167834b..4f1b418 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,7 @@ Changelog ========= +* :support:`-` performance improvement for hosting package detail view * :support:`-` move HostingPackageAndCustomerMixin from managemails.views to gvawebcore.views diff --git a/gnuviechadmin/hostingpackages/views.py b/gnuviechadmin/hostingpackages/views.py index 455e717..75e7cb8 100644 --- a/gnuviechadmin/hostingpackages/views.py +++ b/gnuviechadmin/hostingpackages/views.py @@ -114,6 +114,12 @@ class CustomerHostingPackageDetails(StaffOrSelfLoginRequiredMixin, DetailView): context.update({ 'customer': self.get_customer_object(), 'uploadserver': settings.OSUSER_UPLOAD_SERVER, + 'databases': context['hostingpackage'].databases, + 'osuser': context['hostingpackage'].osuser, + 'hostingoptions': + context['hostingpackage'].get_hostingoptions(), + 'domains': context['hostingpackage'].domains.all(), + 'mailboxes': context['hostingpackage'].mailboxes, }) return context diff --git a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html index eae6752..5ec2849 100644 --- a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html +++ b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html @@ -38,8 +38,8 @@
{% trans "Mailboxes" %}
{% blocktrans with num=hostingpackage.used_mailbox_count total=hostingpackage.mailbox_count %}{{ num }} of {{ total }} in use{% endblocktrans %}
-
{% if hostingpackage.osuser.is_sftp_user %}{% trans "SFTP username" %}{% else %}{% trans "SSH/SFTP username" %}{% endif %}
-
{{ hostingpackage.osuser.username }}
+
{% if osuser.is_sftp_user %}{% trans "SFTP username" %}{% else %}{% trans "SSH/SFTP username" %}{% endif %}
+
{{ osuser.username }}
{% trans "Upload server" %}
{{ uploadserver }}
@@ -48,9 +48,9 @@
{% trans "Hosting Package Options" %}
- {% if hostingpackage.customerhostingpackageoption_set.exists %} + {% if hostingoptions %} @@ -67,7 +67,7 @@
{% trans "Hosting Package Actions" %}
@@ -76,7 +76,7 @@
{% trans "Domains" %}
- {% if hostingpackage.domains %} + {% if domains %} @@ -87,7 +87,7 @@ - {% for domain in hostingpackage.domains.all %} + {% for domain in domains %} {% if domain.domain.maildomain %} @@ -126,7 +126,7 @@
{% trans "E-Mail-Accounts" %}
- {% if hostingpackage.mailboxes %} + {% if mailboxes %}
{{ domain.domain }}
@@ -137,7 +137,7 @@ - {% for mailbox in hostingpackage.mailboxes %} + {% for mailbox in mailboxes %} @@ -161,7 +161,7 @@
{% trans "Databases" %}
- {% if hostingpackage.databases %} + {% if databases %}
{{ mailbox.username }} {{ mailbox.mailaddresses|join:", " }}
@@ -172,11 +172,11 @@ - {% for database in hostingpackage.databases %} + {% for database in databases %} - + {% endfor %}
{% include "userdbs/snippets/db_type.html" with db_type=database.db_user.db_type %} {{ database.db_name }}{{ database.db_user.username }}{{ database.db_user.name }}