From 704c11725c291ff45165acefe3c781e6d3a2d307 Mon Sep 17 00:00:00 2001 From: "yan.bai" Date: Fri, 14 Jun 2024 15:42:48 +0900 Subject: [PATCH] organize service detail page view Update button type Co-authored-by: Paul Traylor pull out service_action_button to new template Bump docker/build-push-action from 5.3.0 to 6.1.0 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.3.0 to 6.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5.3.0...v6.1.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Bump actions/checkout from 4.1.6 to 4.1.7 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.1.6...v4.1.7) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] refactor action buttons format --- promgen/locale/ja/LC_MESSAGES/django.po | 4 ++ promgen/static/css/promgen.css | 13 ++++ .../promgen/service_action_button_group.html | 48 ++++++++++++++ promgen/templates/promgen/service_block.html | 45 +++---------- .../promgen/service_block_projects.html | 24 +------ promgen/templates/promgen/service_detail.html | 63 +++++++++++++++++-- .../promgen/service_detail_projects.html | 20 ++++++ .../service_detail_projects_table.html | 27 ++++++++ 8 files changed, 177 insertions(+), 67 deletions(-) create mode 100644 promgen/templates/promgen/service_action_button_group.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/locale/ja/LC_MESSAGES/django.po b/promgen/locale/ja/LC_MESSAGES/django.po index a13701c8f..c06544ec7 100644 --- a/promgen/locale/ja/LC_MESSAGES/django.po +++ b/promgen/locale/ja/LC_MESSAGES/django.po @@ -172,3 +172,7 @@ msgstr "Serviceを登録" #: templates/promgen/project_detail_hosts.html:49 msgid "Silence selected hosts" msgstr "選択したHostをSilence" + +#: templates/promgen/service_detail.html:23 +msgid "Actions" +msgstr "Actions" diff --git a/promgen/static/css/promgen.css b/promgen/static/css/promgen.css index d106ccbc3..ba90ccfd9 100644 --- a/promgen/static/css/promgen.css +++ b/promgen/static/css/promgen.css @@ -81,6 +81,19 @@ a[rel]:after { cursor: pointer; } + +/* service-detail */ +.promgen-flex-space-between-center { + display: flex; + align-items: center; + justify-content: space-between; +} + +hr { + margin-top: 5px !important; + margin-bottom: 5px !important; +} + /* Margin Top */ .mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 0.25rem !important; } 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_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..890358e0d 100644 --- a/promgen/templates/promgen/service_detail.html +++ b/promgen/templates/promgen/service_detail.html @@ -8,15 +8,66 @@ {% block content %} -