{% extends "base.html" %}
{% load i18n %}
{% block title %}{{ block.super }} - {% blocktranslate with full_name=request.user.get_full_name trimmed %}
    Dashboard for {{ full_name }}
{% endblocktranslate %}{% endblock title %}
{% block page_title %}{% blocktranslate with full_name=request.user.get_full_name trimmed %}
    Dashboard for {{ full_name }}
{% endblocktranslate %}{% endblock page_title %}
{% block content %}
    <h2>{% translate "Hosting packages" %}</h2>
    <div class="row">
        <div class="col-12">
            {% if hosting_packages %}
                <table class="table">
                    <thead>
                    <tr>
                        <th>{% translate "Name" %}</th>
                        <th>{% translate "Setup date" %}</th>
                        <th>{% translate "Actions" %}</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for package in hosting_packages %}
                        <tr>
                            <td><a href="{{ package.get_absolute_url }}"
                                   title="{% blocktranslate with packagename=package.name trimmed %}
                                           Show details for {{ packagename }}
{% endblocktranslate %}">{{ package.name }}</a>
                            </td>
                            <td>{{ package.created }}</td>
                            <td></td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            {% else %}
                <p class="text-info">
                    {% if user == object %}{% translate "You have no hosting packages yet." %}{% else %}
                        {% translate "This user has no hosting packages assigned yet." %}{% endif %}</p>
            {% endif %}
            {% if user.is_staff %}
                <a href="{% url "create_customer_hosting_package" user=request.user.username %}"
                   class="btn btn-primary">{% translate "Add hosting package" %}</a>
            {% endif %}
        </div>
    </div>
{% endblock content %}