From 7991d2bf4f97293fbf920542bc0e64b44d7b86c7 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 24 Jan 2015 22:33:09 +0100 Subject: [PATCH] setup template structure for hosting package - add panels for hosting package options, domains, mailboxes and databases - list existing objects assigned to the hosting package --- .../customerhostingpackage_detail.html | 150 +++++++++++++++++- 1 file changed, 142 insertions(+), 8 deletions(-) diff --git a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html index daa06b5..07728bd 100644 --- a/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html +++ b/gnuviechadmin/templates/hostingpackages/customerhostingpackage_detail.html @@ -13,22 +13,31 @@ {% block content %}
-
+
-
- {% trans "Hosting Package Information" %}
-
+
{% spaceless %} + {% trans "Hosting Package Information" %} + {% if user.is_staff %} +
+ +
+ {% endif %} + {% endspaceless %}
{% trans "Name" %}
{{ hostingpackage.name }}
{% trans "Description" %}
{{ hostingpackage.description|default:"-" }}
{% trans "Disk space" %}
- {% with diskspace=hostingpackage.get_disk_space %} -
{{ diskspace|filesizeformat }}
+ {% with diskspace=hostingpackage.get_disk_space packagespace=hostingpackage.get_package_space %} +
+ {{ diskspace|filesizeformat }} + +
{% endwith %}
{% trans "Mailboxes" %}
-
{% blocktrans with num=hostingpackage.get_used_mailboxes total=hostingpackage.get_mailboxes %}{{ num }} of {{ total }} in use{% endblocktrans %}
+
{% 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 }}
{% trans "Upload server" %}
@@ -36,13 +45,138 @@
-
+
+
+
{% trans "Hosting Package Options" %}
+ {% if hostingpackage.customerhostingpackageoption_set.exists %} +
    + {% for opt in hostingpackage.get_hostingoptions %} +
  • {{ opt }}
  • + {% endfor %} +
+ {% else %} +

{% trans "No options booked" %}

+ {% endif %} + {% if user.is_staff %} +

{% trans "Add option" %}

+ {% endif %} +
+
+
+
+
+
+
{% trans "Domains" %}
+ {% if hostingpackage.domains %} + + + + + + + + + + + {% for domain in hostingpackage.domains.all %} + + + {% if domain.domain.maildomain %} + + {% else %} + + {% endif %} + + + + {% endfor %} + +
{% trans "Domain name" %}{% trans "Mail addresses" %}{% trans "Websites" %}{% trans "Actions" %}
{{ domain.domain }}{{ domain.domain.maildomain.mailaddresses|join:", " }}{% trans "None" %}
+ {% else %} +

{% trans "There are no domains assigned to this hosting package yet." %}

+ {% endif %} + {% if user.is_staff %} +

{% trans "Add domain" %}

+ {% endif %} +
+
+
+
+
+
+
{% trans "E-Mail-Accounts" %}
+ {% if hostingpackage.mailboxes %} + + + + + + + + + + + {% for mailbox in hostingpackage.mailboxes %} + + + + + + {% endfor %} + +
{% trans "Mailbox" %}{% trans "Mail addresses" %}{% trans "Active" %}{% trans "Actions" %}
{{ mailbox.username }}{{ mailbox.mailaddresses|join:", " }} {% if mailbox.active %}{% trans "Active" %}{% else %}{% trans "inactive" %}{% endif %} + {% trans "Set mailbox password" %} +
+ {% else %} +

{% trans "There are no mailboxes assigned to this hosting package yet." %}

+ {% endif %} + {% if hostingpackage.may_add_mailbox %} +

{% trans "Add mailbox" %}

+ {% endif %} +
+
+
+
+
+
+
{% trans "Databases" %}
+ {% if hostingpackage.databases %} + + + + + + + + + + + {% for database in hostingpackage.databases %} + + + + + + + {% endfor %} + +
{% trans "Type" %}{% trans "Database name" %}{% trans "Database user" %}{% trans "Actions" %}
{% include "userdbs/snippets/db_type.html" with db_type=database.db_user.db_type %}{{ database.db_name }}{{ database.db_user.username }}
+ {% else %} +

{% trans "There are no databases assigned to this hosting package yet." %}

+ {% endif %} + {% if hostingpackage.may_add_database %} +

{% trans "Add database" %}

+ {% endif %} +
+
+
{% endblock content %}