From c9696a51ac7e270accaf0629f50da76df667d7d4 Mon Sep 17 00:00:00 2001 From: Blair Date: Wed, 24 Jul 2024 15:27:17 +0900 Subject: [PATCH] refactor action buttons --- .../promgen/service_action_button.html | 28 ----------- .../promgen/service_action_button_group.html | 48 +++++++++++++++++++ promgen/templates/promgen/service_block.html | 45 +++-------------- promgen/templates/promgen/service_detail.html | 8 +--- 4 files changed, 56 insertions(+), 73 deletions(-) delete mode 100644 promgen/templates/promgen/service_action_button.html create mode 100644 promgen/templates/promgen/service_action_button_group.html diff --git a/promgen/templates/promgen/service_action_button.html b/promgen/templates/promgen/service_action_button.html deleted file mode 100644 index 84bf1b67b..000000000 --- a/promgen/templates/promgen/service_action_button.html +++ /dev/null @@ -1,28 +0,0 @@ -{% load i18n %} -{% load promgen %} - -
- - -
diff --git a/promgen/templates/promgen/service_action_button_group.html b/promgen/templates/promgen/service_action_button_group.html new file mode 100644 index 000000000..77bf524fd --- /dev/null +++ b/promgen/templates/promgen/service_action_button_group.html @@ -0,0 +1,48 @@ +{% load i18n %} +{% load promgen %} + + +
+ + {% translate "Silence" %} + + {% translate "Edit Service" %} + +
diff --git a/promgen/templates/promgen/service_block.html b/promgen/templates/promgen/service_block.html index 7d768bc6d..d27003cb8 100644 --- a/promgen/templates/promgen/service_block.html +++ b/promgen/templates/promgen/service_block.html @@ -33,50 +33,19 @@
-
+ -
{% csrf_token %} - - - -
+ {% include "promgen/service_action_button_group.html" %} -
- - -
- - {% trans "Edit Service" %} - {% trans "Silence" %} - - - -
- {% csrf_token %} - -
@@ -89,7 +58,7 @@
diff --git a/promgen/templates/promgen/service_detail.html b/promgen/templates/promgen/service_detail.html index 8f472d6b0..7a120e933 100644 --- a/promgen/templates/promgen/service_detail.html +++ b/promgen/templates/promgen/service_detail.html @@ -16,15 +16,9 @@

Service: {{ service.name }}

{% endif %} -
- - {% include "promgen/service_action_button.html" %} - {% translate "Silence" %} + {% include "promgen/service_action_button_group.html" %} - {% translate "Edit Service" %} - -
{% breadcrumb service %}