From 1c7574df9a98f8f72c00a1d2a404fa7f6e9459e5 Mon Sep 17 00:00:00 2001 From: Blair Date: Wed, 23 Oct 2024 11:35:01 +0900 Subject: [PATCH] Organize Service View Page with Tabs --- promgen/templates/promgen/service_block.html | 21 +------- .../service_block_panel_notifiers.inc.html | 7 +++ .../service_block_panel_rules.inc.html | 17 +++++++ .../promgen/service_block_projects.html | 24 +--------- promgen/templates/promgen/service_detail.html | 48 ++++++++++++++++--- .../promgen/service_detail_projects.html | 20 ++++++++ .../service_detail_projects_table.html | 27 +++++++++++ 7 files changed, 116 insertions(+), 48 deletions(-) create mode 100644 promgen/templates/promgen/service_block_panel_notifiers.inc.html create mode 100644 promgen/templates/promgen/service_block_panel_rules.inc.html create mode 100644 promgen/templates/promgen/service_detail_projects.html create mode 100644 promgen/templates/promgen/service_detail_projects_table.html diff --git a/promgen/templates/promgen/service_block.html b/promgen/templates/promgen/service_block.html index f4958c268..46c843b15 100644 --- a/promgen/templates/promgen/service_block.html +++ b/promgen/templates/promgen/service_block.html @@ -51,26 +51,9 @@ - {% if service.rule_set.count or request.site.rule_set.count %} -
- - {% include "promgen/rule_header.html" %} - {% include "promgen/rule_block.html" with rule_list=service.rule_set.all toggle=1 delete=1 %} - {% include "promgen/rule_block.html" with rule_list=request.site.rule_set.all collapse="service-site-rules-" overwrite_type='service' overwrite_id=service.id %} -
- -
- {% endif %} + {% include "promgen/service_block_panel_rules.inc.html" %} - {% if service.notifiers.count %} -
- {% include "promgen/notifier_block.html" with object=service show_edit=1 %} -
- {% endif %} + {% include "promgen/service_block_panel_notifiers.inc.html" %} {% include "promgen/service_block_projects.html" with project_list=project_list|default:service.project_set.all service=service only %} diff --git a/promgen/templates/promgen/service_block_panel_notifiers.inc.html b/promgen/templates/promgen/service_block_panel_notifiers.inc.html new file mode 100644 index 000000000..608beb4e5 --- /dev/null +++ b/promgen/templates/promgen/service_block_panel_notifiers.inc.html @@ -0,0 +1,7 @@ +{% load promgen %} + +{% if service.notifiers.count %} +
+ {% include "promgen/notifier_block.html" with object=service show_edit=1 %} +
+{% endif %} diff --git a/promgen/templates/promgen/service_block_panel_rules.inc.html b/promgen/templates/promgen/service_block_panel_rules.inc.html new file mode 100644 index 000000000..5b3c6095b --- /dev/null +++ b/promgen/templates/promgen/service_block_panel_rules.inc.html @@ -0,0 +1,17 @@ +{% load i18n %} +{% load promgen %} + +{% if service.rule_set.count or request.site.rule_set.count %} +
+ + {% include "promgen/rule_header.html" %} + {% include "promgen/rule_block.html" with rule_list=service.rule_set.all toggle=1 delete=1 %} + {% include "promgen/rule_block.html" with rule_list=request.site.rule_set.all collapse="service-site-rules-" overwrite_type='service' overwrite_id=service.id %} +
+ +
+{% endif %} diff --git a/promgen/templates/promgen/service_block_projects.html b/promgen/templates/promgen/service_block_projects.html index fd4540a03..bde08579b 100644 --- a/promgen/templates/promgen/service_block_projects.html +++ b/promgen/templates/promgen/service_block_projects.html @@ -10,30 +10,8 @@ ( {{shard.url}} ) {% trans "Register Project" %} - - - - - - - - {% for project in shard_projects %} - {% if service.notifiers.count == 0 and project.notifiers.count == 0 %} - - - - {% endif %} + {% include 'promgen/service_detail_projects_table.html' with shard_projects=shard_projects service=service %} - {% include 'promgen/project_row.html' %} - {% empty %} - - - - {% endfor %} -
ProjectExportersNotifiersActions
- - {% trans "No notifications configured for this project. Please configure some" %} -
No Projects?
{% endfor %} diff --git a/promgen/templates/promgen/service_detail.html b/promgen/templates/promgen/service_detail.html index 556b8e1b6..361aaad07 100644 --- a/promgen/templates/promgen/service_detail.html +++ b/promgen/templates/promgen/service_detail.html @@ -8,15 +8,51 @@ {% block content %} -