Skip to content

Commit 4969424

Browse files
author
0ko
committed
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 <[email protected]>
1 parent da2a92f commit 4969424

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

templates/admin/repo/unadopted.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<input type="hidden" name="action" value="delete">
5555
<input type="hidden" name="q" value="{{$.Keyword}}">
5656
<input type="hidden" name="page" value="{{$.CurrentPage}}">
57-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "primary")}}
57+
{{template "base/modal_actions_confirm"}}
5858
</form>
5959
</div>
6060
</div>

templates/base/modal_actions_confirm.tmpl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{/*
22
Two buttons (negative, positive):
33
* ModalButtonTypes: "yes" (default) or "confirm"
4-
* ModalButtonColors: "primary" (default) / "blue" / "yellow"
54
* ModalButtonCancelText
65
* ModalButtonOkText
76

@@ -23,13 +22,7 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal
2322
{{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}}
2423
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
2524

26-
{{$stylePositive := "primary"}}
27-
{{if eq .ModalButtonColors "blue"}}
28-
{{$stylePositive = "blue"}}
29-
{{else if eq .ModalButtonColors "yellow"}}
30-
{{$stylePositive = "yellow"}}
31-
{{end}}
3225
<button class="ui cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
33-
<button class="ui {{$stylePositive}} ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
26+
<button class="ui primary ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
3427
{{end}}
3528
</div>

templates/devtest/fomantic-modal.tmpl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,6 @@
5454
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
5555
</div>
5656

57-
<div class="ui g-modal-confirm modal" id="test-modal-blue">
58-
<div class="header">Blue dialog</div>
59-
<div class="content">hello, this is the modal dialog content</div>
60-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "blue")}}
61-
</div>
62-
63-
<div class="ui g-modal-confirm modal" id="test-modal-yellow">
64-
<div class="header">yellow dialog</div>
65-
<div class="content">hello, this is the modal dialog content</div>
66-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "yellow")}}
67-
</div>
68-
6957
<div class="ui g-modal-confirm modal" id="test-modal-danger">
7058
{{svg "octicon-x" 16 "inside close"}}
7159
<div class="header">dangerous action dialog</div>

templates/repo/settings/lfs.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</p>
4545
<form class="ui form" action="{{$.Link}}/delete/{{.Oid}}" method="post">
4646
{{$.CsrfTokenHtml}}
47-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "primary")}}
47+
{{template "base/modal_actions_confirm"}}
4848
</form>
4949
</div>
5050
</div>

templates/user/settings/applications.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<div class="content">
123123
<p>{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}</p>
124124
</div>
125-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "primary")}}
125+
{{template "base/modal_actions_confirm"}}
126126
</div>
127127

128128
{{template "user/settings/layout_footer" .}}

0 commit comments

Comments
 (0)