From 156ab51f339148e9d2efe3b8c6dccb1154ae68e4 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 30 Jan 2024 13:43:27 +0100 Subject: [PATCH] Cosmetics: make database list more compact --- .../templates/musician/database_list.html | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/orchestra/contrib/musician/templates/musician/database_list.html b/orchestra/contrib/musician/templates/musician/database_list.html index 4869b419..3915ad3b 100644 --- a/orchestra/contrib/musician/templates/musician/database_list.html +++ b/orchestra/contrib/musician/templates/musician/database_list.html @@ -6,49 +6,47 @@

{{ service.verbose_name }}

{{ service.description }}

-{% for database in object_list %} -
-
-
-
- {{ database.name }} -
-
- {% trans "Type" %}: {{ database.type }} -
-
- {% comment "@slamora: orchestra doesn't provide this information [won't fix] See issue #3" %} - {% trans "associated to" %}: {{ database.domain|default:"-" }} - {% endcomment %} -
-
-
-
-
-

Database users

-
    - {% for user in database.users.all %} - {# TODO(@slamora) render in two columns #} -
  • {{ user.username }}
  • - {% empty %} -
  • {% trans "No users for this database." %}
  • - {% endfor %} -
-
-
-

Database usage

-

- {% include "musician/components/usage_progress_bar.html" with detail=database.usage %} -
- -
-
+{% if object_list %} -{% empty %} + + + + + + + + + + + + + + + + + {% for database in object_list %} + + + + + + + {% endfor %} + + {% include "musician/components/table_paginator.html" %} +
{% trans "Name" %}{% trans "Type" %}{% trans "Database users" %} {% trans "Disk usage" %}
{{ database.name }} + {{ database.type }} + + + {% trans "Open database manager" %} + + {{ database.users.all|join:", " }} + {% with detail=database.usage %} + {{ detail.used|floatformat }} {{ detail.unit }} + {% endwith %} +
+ +{% else %}
@@ -60,9 +58,6 @@
-{% endfor %} +{% endif %} - {% if object_list|length > 0 %} - {% include "musician/components/paginator.html" %} - {% endif %} {% endblock %}