- prefetch database objects in CustomerHostingPackageDetails.get_context_data - use prefetched data in template hostingpackage/customerhostingpackage_detail.html - mention optimization in changelog
		
			
				
	
	
		
			194 lines
		
	
	
	
		
			9.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			194 lines
		
	
	
	
		
			9.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends "hostingpackages/base.html" %}
 | 
						|
{% load i18n %}
 | 
						|
 | 
						|
{% block title %}{{ block.super }} - {% spaceless %}
 | 
						|
{% if user == customer %}
 | 
						|
  {% blocktrans with package=hostingpackage.name %}Details for your Hosting Package {{ package }}{% endblocktrans %}
 | 
						|
{% else %}
 | 
						|
  {% blocktrans with package=hostingpackage.name full_name=customer.get_full_name %}Details for Hosting Package {{ package }} of {{ full_name }}{% endblocktrans %}
 | 
						|
{% endif %}
 | 
						|
{% endspaceless %}{% endblock title %}
 | 
						|
 | 
						|
{% block page_title %}{% blocktrans with package=hostingpackage.name %}Details of Hosting Package {{ package }}{% endblocktrans %}{% endblock page_title %}
 | 
						|
 | 
						|
{% block content %}
 | 
						|
<div class="row">
 | 
						|
  <div class="col-lg-4 col-md-6 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% spaceless %}
 | 
						|
        {% trans "Hosting Package Information" %}
 | 
						|
        {% if user.is_staff %}
 | 
						|
        <div class="pull-right">
 | 
						|
          <a class="panel-title" href="#" title="{% trans "Edit Hosting Package Information" %}"><i class="glyphicon glyphicon-cog"></i></a>
 | 
						|
        </div>
 | 
						|
        {% endif %}
 | 
						|
      {% endspaceless %}</div>
 | 
						|
      <dl class="panel-body dl-horizontal">
 | 
						|
        <dt>{% trans "Name" %}</dt>
 | 
						|
        <dd>{{ hostingpackage.name }}</dd>
 | 
						|
        <dt>{% trans "Description" %}</dt>
 | 
						|
        <dd>{{ hostingpackage.description|default:"-" }}</dd>
 | 
						|
        <dt>{% trans "Disk space" %}</dt>
 | 
						|
        {% with diskspace=hostingpackage.get_disk_space packagespace=hostingpackage.get_package_space %}
 | 
						|
        <dd>
 | 
						|
          <span title="{% blocktrans %}The reserved disk space for your hosting package is {{ diskspace }} bytes{% endblocktrans %}">{{ diskspace|filesizeformat }}</span>
 | 
						|
          <span class="glyphicon glyphicon-info-sign" title="{% blocktrans with humanbytes=packagespace|filesizeformat %}The package contributes {{ humanbytes }} ({{ packagespace }} bytes) the difference comes from disk space options{% endblocktrans %}"></span>
 | 
						|
        </dd>
 | 
						|
        {% endwith %}
 | 
						|
        <dt>{% trans "Mailboxes" %}</dt>
 | 
						|
        <dd>{% blocktrans with num=hostingpackage.used_mailbox_count total=hostingpackage.mailbox_count %}{{ num }} of {{ total }} in use{% endblocktrans %} <span class="glyphicon
 | 
						|
        glyphicon-info-sign" title="{% blocktrans with mailboxes=hostingpackage.mailboxcount %}The package provides {{ mailboxcount }} mailboxes the difference comes from mailbox options.{% endblocktrans %}"></span></dd>
 | 
						|
        <dt>{% if osuser.is_sftp_user %}{% trans "SFTP username" %}{% else %}{% trans "SSH/SFTP username" %}{% endif %}</dt>
 | 
						|
        <dd>{{ osuser.username }}</dd>
 | 
						|
        <dt>{% trans "Upload server" %}</dt>
 | 
						|
        <dd>{{ uploadserver }}</dd>
 | 
						|
      </dl>
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
  <div class="col-lg-4 col-md-6 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% trans "Hosting Package Options" %}</div>
 | 
						|
      {% if hostingoptions %}
 | 
						|
      <ul class="list-group">
 | 
						|
        {% for opt in hostingoptions %}
 | 
						|
        <li class="list-group-item">{{ opt }}</li>
 | 
						|
        {% endfor %}
 | 
						|
      </ul>
 | 
						|
      {% else %}
 | 
						|
      <p class="panel-body text-info">{% trans "No options booked" %}</p>
 | 
						|
      {% endif %}
 | 
						|
      {% if user.is_staff %}
 | 
						|
      <p class="panel-body"><a class="btn btn-primary" href="{% url 'hosting_option_choices' pk=hostingpackage.id %}" title="{% trans "Add another hosting option" %}">{% trans "Add option" %}</a></p>
 | 
						|
      {% endif %}
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
  <div class="col-lg-4 col-md-6 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% trans "Hosting Package Actions" %}</div>
 | 
						|
      <ul class="list-group">
 | 
						|
        <li class="list-group-item"><a href="#" title="{% trans "Edit Hosting Package Description" %}">{% trans "Edit description" %}</a></li>
 | 
						|
        <li class="list-group-item"><a href="{% url "set_osuser_password" slug=osuser.username %}">{% if osuser.is_sftp %}{% trans "Set SFTP password" %}{% else %}{% trans "Set SSH/SFTP password" %}{% endif %}</a></li>
 | 
						|
      </ul>
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
<div class="row">
 | 
						|
  <div class="col-lg-12 col-md-12 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% trans "Domains" %}</div>
 | 
						|
      {% if domains %}
 | 
						|
      <table class="table table-condensed">
 | 
						|
        <thead>
 | 
						|
          <tr>
 | 
						|
            <th>{% trans "Domain name" %}</th>
 | 
						|
            <th>{% trans "Mail addresses" %}</th>
 | 
						|
            <th>{% trans "Websites" %}</th>
 | 
						|
            <th title="{% trans "Domain actions" %}"><span class="sr-only">{% trans "Actions" %}</span></th>
 | 
						|
          </tr>
 | 
						|
        </thead>
 | 
						|
        <tbody>
 | 
						|
          {% for domain in domains %}
 | 
						|
          <tr>
 | 
						|
            <td>{{ domain.domain }}</td>
 | 
						|
            {% if domain.domain.maildomain %}
 | 
						|
            <td>
 | 
						|
              {% with maildomain=domain.domain.maildomain %}
 | 
						|
              {% for mailaddress in maildomain.mailaddresses %}{% spaceless %}
 | 
						|
              <a href="{% url 'edit_mailaddress' package=hostingpackage.id domain=maildomain.domain pk=mailaddress.id %}" title="{% trans "Edit mail address targets" %}">{{ mailaddress }}</a>
 | 
						|
              <a href="{% url 'delete_mailaddress' package=hostingpackage.id domain=maildomain.domain pk=mailaddress.id %}" title="{% trans "Delete mail address" %}"><i class="glyphicon glyphicon-trash"></i></a>
 | 
						|
              {% endspaceless %}{% if not forloop.last %}, {% endif %}
 | 
						|
              {% endfor %}
 | 
						|
              {% endwith %}
 | 
						|
            </td>
 | 
						|
            {% else %}
 | 
						|
            <td class="text-info">{% trans "None" %}</td>
 | 
						|
            {% endif %}
 | 
						|
            <td></td>
 | 
						|
            <td>
 | 
						|
              {% with maildomain=domain.domain.maildomain %}
 | 
						|
              <a href="{% url 'add_mailaddress' package=hostingpackage.id domain=maildomain.domain %}" title="{% trans "Add mail address" %}"><i class="fa fa-envelope"></i></a>
 | 
						|
              {% endwith %}
 | 
						|
            </td>
 | 
						|
          </tr>
 | 
						|
          {% endfor %}
 | 
						|
        </tbody>
 | 
						|
      </table>
 | 
						|
      {% else %}
 | 
						|
      <p class="panel-body text-info">{% trans "There are no domains assigned to this hosting package yet." %}</p>
 | 
						|
      {% endif %}
 | 
						|
      {% if user.is_staff %}
 | 
						|
      <p class="panel-body"><a href="{% url 'create_hosting_domain' package=hostingpackage.id %}" class="btn btn-primary">{% trans "Add domain" %}</a></p>
 | 
						|
      {% endif %}
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
<div class="row">
 | 
						|
  <div class="col-lg-12 col-md-12 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% trans "E-Mail-Accounts" %}</div>
 | 
						|
      {% if mailboxes %}
 | 
						|
      <table class="table table-condensed">
 | 
						|
        <thead>
 | 
						|
          <tr>
 | 
						|
            <th>{% trans "Mailbox" %}</th>
 | 
						|
            <th>{% trans "Mail addresses" %}</th>
 | 
						|
            <th>{% trans "Active" %}</th>
 | 
						|
            <th title="{% trans "Mailbox actions" %}"><span class="sr-only">{% trans "Actions" %}</span></th>
 | 
						|
          </tr>
 | 
						|
        </thead>
 | 
						|
        <tbody>
 | 
						|
          {% for mailbox in mailboxes %}
 | 
						|
          <tr>
 | 
						|
            <td>{{ mailbox.username }}</td>
 | 
						|
            <td>{{ mailbox.mailaddresses|join:", " }}</td>
 | 
						|
            <td><i class="glyphicon glyphicon-{% if mailbox.active %}ok-circle{% else %}minus-sign{% endif %}"></i><span class="sr-only"> {% if mailbox.active %}{% trans "Active" %}{% else %}{% trans "inactive" %}{% endif %}</span></td>
 | 
						|
            <td>
 | 
						|
              <a href="{% url 'change_mailbox_password' package=hostingpackage.id slug=mailbox.username %}"><i class="fa fa-user-secret" title="{% trans "Set mailbox password" %}"></i><span class="sr-only"> {% trans "Set mailbox password" %}</span></a>
 | 
						|
            </td>
 | 
						|
          {% endfor %}
 | 
						|
        </tbody>
 | 
						|
      </table>
 | 
						|
      {% else %}
 | 
						|
      <p class="panel-body text-info">{% trans "There are no mailboxes assigned to this hosting package yet." %}</p>
 | 
						|
      {% endif %}
 | 
						|
      {% if hostingpackage.may_add_mailbox %}
 | 
						|
      <p class="panel-body"><a href="{% url 'create_mailbox' package=hostingpackage.id %}" class="btn btn-primary">{% trans "Add mailbox" %}</a></p>
 | 
						|
      {% endif %}
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
<div class="row">
 | 
						|
  <div class="col-lg-12 col-md-12 col-xs-12">
 | 
						|
    <div class="panel panel-default">
 | 
						|
      <div class="panel-heading">{% trans "Databases" %}</div>
 | 
						|
      {% if databases %}
 | 
						|
      <table class="table table-condensed">
 | 
						|
        <thead>
 | 
						|
          <tr>
 | 
						|
            <th title="{% trans "Database type" %}"><span class="sr-only">{% trans "Type" %}</span></th>
 | 
						|
            <th>{% trans "Database name" %}</th>
 | 
						|
            <th>{% trans "Database user" %}</th>
 | 
						|
            <th title="{% trans "Database actions" %}"><span class="sr-only">{% trans "Actions" %}</span></th>
 | 
						|
          </tr>
 | 
						|
        </thead>
 | 
						|
        <tbody>
 | 
						|
          {% for database in databases %}
 | 
						|
          <tr>
 | 
						|
            <td>{% include "userdbs/snippets/db_type.html" with db_type=database.db_user.db_type %}</td>
 | 
						|
            <td>{{ database.db_name }}</td>
 | 
						|
            <td>{{ database.db_user.name }}</td>
 | 
						|
            <td></td>
 | 
						|
          </tr>
 | 
						|
          {% endfor %}
 | 
						|
        </tbody>
 | 
						|
      </table>
 | 
						|
      {% else %}
 | 
						|
      <p class="panel-body text-info">{% trans "There are no databases assigned to this hosting package yet." %}</p>
 | 
						|
      {% endif %}
 | 
						|
      {% if hostingpackage.may_add_database %}
 | 
						|
      <p class="panel-body"><a href="#" class="btn btn-primary">{% trans "Add database" %}</a></p>
 | 
						|
      {% endif %}
 | 
						|
    </div>
 | 
						|
  </div>
 | 
						|
</div>
 | 
						|
{% endblock content %}
 |