107 lines
3.6 KiB
HTML
107 lines
3.6 KiB
HTML
{% extends "musician/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block content %}
|
|
|
|
<h2 style="margin-top: 10px;">{% trans "Welcome back" %} <strong>{{ profile.username }}</strong></h2>
|
|
{% if profile.last_login %}
|
|
<p>{% blocktrans with last_login=profile.last_login|date:"SHORT_DATE_FORMAT" %}Last time you logged in was: {{ last_login }}{% endblocktrans %}</p>
|
|
{% else %}
|
|
<p>{% trans "It's the first time you log into the system, welcome on board!" %}</p>
|
|
{% endif %}
|
|
|
|
<div class="alert alert-secondary" role="alert">
|
|
{% blocktrans %} The disk space of resources is updated weekly {% endblocktrans %}
|
|
</div>
|
|
|
|
<!-- Deck account -->
|
|
<div class="card-deck">
|
|
<div class="card resource-usage resource-account">
|
|
<div class="card-body">
|
|
<h5 class="card-title">{{ account.verbose_name }}</h5>
|
|
<div class="text-center">
|
|
{% if account.data and account.data.used %}
|
|
{{ account.data.used|floatformat }} {{ account.data.unit }}
|
|
{% endif %}
|
|
</div>
|
|
{% if account.data.progres_bar %}
|
|
<div class="progress">
|
|
<div class="progress-bar bg-secondary" style="width: {{ account.data.percent }}%"></div>
|
|
</div>
|
|
{% endif %}
|
|
{% if account.data.alert %}
|
|
<div class="text-center mt-4">
|
|
{{ account.data.alert }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<ul class="list-group">
|
|
{% for name, obj_data in account.objects.items %}
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
{{ name }}
|
|
<span class="badge badge-primary badge-pill">{{ obj_data.ac.used }} {{ obj_data.ac.unit }}</span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Deck resources -->
|
|
<div class="card-deck">
|
|
|
|
{% for resource, usage in resource_usage.items %}
|
|
<div class="card resource-usage resource-{{ resource }}">
|
|
<div class="card-body" data-toggle="collapse" data-target="#collapse-{{ resource }}">
|
|
<h5 class="card-title">{{ usage.verbose_name }}</h5>
|
|
<div class="text-center">
|
|
{% if usage.data and usage.data.used %}
|
|
{{ usage.data.used|floatformat }} {{ usage.data.unit }}
|
|
{% endif %}
|
|
</div>
|
|
{% if usage.data.progres_bar %}
|
|
<div class="progress">
|
|
<div class="progress-bar bg-secondary" style="width: {{ usage.data.percent }}%"></div>
|
|
</div>
|
|
{% endif %}
|
|
{% if usage.data.alert %}
|
|
<div class="text-center mt-4">
|
|
{{ usage.data.alert }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div id="collapse-{{ resource }}" class="collapse">
|
|
<ul class="list-group">
|
|
{% for obj_data in usage.objects %}
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
{{ obj_data }}
|
|
<span class="badge badge-primary badge-pill">{{ obj_data.used }} {{ obj_data.resource.unit }}</span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<!-- card domains -->
|
|
<div class="card resource-usage resource-domains">
|
|
<div class="card-body" data-toggle="collapse" data-target="#collapse-domains">
|
|
<h5 class="card-title">{% trans "Domains" %}</h5>
|
|
<div class="text-center">{{ domains|length }} {% trans "Domains" %}</div>
|
|
</div>
|
|
<div id="collapse-domains" class="collapse">
|
|
<ul class="list-group">
|
|
{% for domain in domains %}
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
{{ domain }}
|
|
<a href="{% url 'musician:domain-list'%}" rel="noopener noreferrer"><i class="fas fa-external-link-alt"></i></a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
{% endblock %}
|
|
|