From 49694242d4034040bb4564a2e9a20bc9c819c451 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Sun, 9 Mar 2025 07:45:58 +0000 Subject: [PATCH] chore(ui): always use primary button color inside modals (#7161) Followup to https://codeberg.org/forgejo/forgejo/pulls/3002 Related to https://codeberg.org/forgejo/forgejo/pulls/6126 This deimplements `ModalButtonColors`. Nowhere in the UI except for one devtest page modal dialogs paint this button any other color and we don't want new UIs to do that. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7161 Reviewed-by: Gusted --- templates/admin/repo/unadopted.tmpl | 2 +- templates/base/modal_actions_confirm.tmpl | 9 +-------- templates/devtest/fomantic-modal.tmpl | 12 ------------ templates/repo/settings/lfs.tmpl | 2 +- templates/user/settings/applications.tmpl | 2 +- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index a33cb43a2f..a95f6b5120 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -54,7 +54,7 @@ - {{template "base/modal_actions_confirm" (dict "ModalButtonColors" "primary")}} + {{template "base/modal_actions_confirm"}} diff --git a/templates/base/modal_actions_confirm.tmpl b/templates/base/modal_actions_confirm.tmpl index c44320deff..8c4e346088 100644 --- a/templates/base/modal_actions_confirm.tmpl +++ b/templates/base/modal_actions_confirm.tmpl @@ -1,7 +1,6 @@ {{/* Two buttons (negative, positive): * ModalButtonTypes: "yes" (default) or "confirm" -* ModalButtonColors: "primary" (default) / "blue" / "yellow" * ModalButtonCancelText * ModalButtonOkText @@ -23,13 +22,7 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal {{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}} {{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}} - {{$stylePositive := "primary"}} - {{if eq .ModalButtonColors "blue"}} - {{$stylePositive = "blue"}} - {{else if eq .ModalButtonColors "yellow"}} - {{$stylePositive = "yellow"}} - {{end}} - + {{end}} diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index 5cd36721a7..5b94afc4f1 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/devtest/fomantic-modal.tmpl @@ -54,18 +54,6 @@ {{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}} - - - - diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 38ede95a77..9a806d0665 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -122,7 +122,7 @@

{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}

- {{template "base/modal_actions_confirm" (dict "ModalButtonColors" "primary")}} + {{template "base/modal_actions_confirm"}} {{template "user/settings/layout_footer" .}}