-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/ralph/admin/templates/admin/templatetags/my_services.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{% load cache i18n dashboard_tags %} | ||
|
||
{% if services %} | ||
{% cache 60 my_services request.user %} | ||
<div class="services module row"> | ||
<table class="full"> | ||
<h2>{% trans "My services" %}</h2> | ||
<thead> | ||
<tr> | ||
<th>{% trans "Service" %}</th> | ||
<th>{% trans "Environment" %}</th> | ||
<th>{% trans "Assets count" %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for service in services %} | ||
<tr> | ||
<td rowspan="{{ service.serviceenvironment_set.count|add:"1" }}"> | ||
<a href="{% url 'admin:data_center_dchost_changelist' %}?service_env={% for service_env in service.serviceenvironment_set.all %}{{ service_env.id }}{% if not forloop.last %},{% endif %}{% endfor %}">{{ service }}</a> | ||
</td> | ||
</tr> | ||
{% for service_env in service.serviceenvironment_set.all %} | ||
<tr> | ||
<td> | ||
<a href="{% url 'admin:data_center_dchost_changelist' %}?service_env={{ service_env.id }}"> | ||
{{ service_env.environment }} ({{ service_env.baseobject_set.count }}) | ||
</a> | ||
</td> | ||
<td> | ||
{% regroup service_env.baseobject_set.all by content_type as content_types %} | ||
{% for type in content_types %} | ||
<ul> | ||
<li>{% get_objects_summary service_env type.grouper type.list %}</li> | ||
</ul> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% endcache %} | ||
{% endif %} |
1 change: 1 addition & 0 deletions
1
src/ralph/admin/templates/admin/templatetags/objects_summary.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a href="{{ url }}">{{ name }}: {{ count }}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters