add link hosting package list templates

- add link to hosting package list for staff users in top navigation
- add new template hostingpackages/customerhostingpackage_admin_list.html
This commit is contained in:
Jan Dittberner 2015-01-24 23:37:20 +01:00
parent 4bffa5ec62
commit bf91664f6e
2 changed files with 36 additions and 1 deletions

View file

@ -45,7 +45,10 @@
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="{% if user.is_authenticated %}{% url 'customer_dashboard' slug=user.username %}{% else %}{% url 'dashboard' %}{% endif %}">Home</a></li>
<li class="active"><a href="{% if user.is_authenticated %}{% url 'customer_dashboard' slug=user.username %}{% else %}{% url 'dashboard' %}{% endif %}">{% trans "Dashboard" %}</a></li>
{% if user.is_staff %}
<li><a href="{% url 'all_hosting_packages' %}">{% trans "All hosting packages" %}</a></li>
{% endif %}
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>

View file

@ -0,0 +1,32 @@
{% extends "hostingpackages/base.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {% trans "All hosting packages" %}{% endblock title %}
{% block page_title %}{% trans "All hosting packages" %}{% endblock page_title %}
{% block content %}
{% if customerhostingpackage_list %}
<table class="table table-condensed">
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Customer" %}</th>
<th>{% trans "Setup date" %}</th>
</tr>
</thead>
<tbody>
{% for package in customerhostingpackage_list %}
<tr>
<td><a href="{{ package.get_absolute_url }}">{{ package.name }}</a></td>
<td><a href="{% url 'customer_dashboard' slug=package.customer.username %}">{{ package.customer }}</a></td>
<td>{{ package.created }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-info">{% trans "There are no hosting packages setup yet." %}</p>
{% endif %}
<p>
<a href="{% url 'create_hosting_package' %}" class="btn btn-primary">{% trans "Add hosting package" %}</a>
</p>
{% endblock content %}