Skip to content

Commit 3b0f6d6

Browse files
committed
remove ModalButtonColors, fix modal close icon
1 parent 8476113 commit 3b0f6d6

File tree

6 files changed

+11
-26
lines changed

6 files changed

+11
-26
lines changed

templates/admin/repo/unadopted.tmpl

+1-1
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" "yellow")}}
57+
{{template "base/modal_actions_confirm"}}
5858
</form>
5959
</div>
6060
</div>

templates/base/modal_actions_confirm.tmpl

+1-9
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

@@ -22,14 +21,7 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal
2221
{{end}}
2322
{{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}}
2423
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
25-
26-
{{$stylePositive := "primary"}}
27-
{{if eq .ModalButtonColors "blue"}}
28-
{{$stylePositive = "blue"}}
29-
{{else if eq .ModalButtonColors "yellow"}}
30-
{{$stylePositive = "yellow"}}
31-
{{end}}
3224
<button class="ui cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
33-
<button class="ui {{$stylePositive}} ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
25+
<button class="ui primary ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
3426
{{end}}
3527
</div>

templates/devtest/fomantic-modal.tmpl

+2-14
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,17 @@
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>
7260
<div class="content">hello, this is the modal dialog content, this is a dangerous operation</div>
7361
{{template "base/modal_actions_confirm" (dict "ModalButtonDangerText" "I know and must do this is dangerous operation")}}
7462
</div>
7563

76-
<div class="modal-buttons flex-text-block tw-flex-wrap"></div>
64+
<div class="modal-buttons flex-text-block tw-flex-wrap tw-p-3"></div>
7765
<script type="module">
7866
for (const el of $('.ui.modal')) {
79-
const $btn = $('<button>').text(`${el.id}`).on('click', () => {
67+
const $btn = $('<button class="ui button">').text(`${el.id}`).on('click', () => {
8068
$(el).modal({onApprove() {alert('confirmed')}}).modal('show');
8169
});
8270
$('.modal-buttons').append($btn);

templates/repo/settings/lfs.tmpl

+1-1
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" "yellow")}}
47+
{{template "base/modal_actions_confirm"}}
4848
</form>
4949
</div>
5050
</div>

templates/user/settings/applications.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<div class="content">
110110
<p>{{ctx.Locale.Tr "settings.access_token_deletion_desc"}}</p>
111111
</div>
112-
{{template "base/modal_actions_confirm" (dict "ModalButtonColors" "yellow")}}
112+
{{template "base/modal_actions_confirm"}}
113113
</div>
114114

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

web_src/css/modules/modal.css

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
top: 1.2em;
1111
}
1212

13+
.ui.modal > .close.inside,
14+
.ui.fullscreen.modal > .close {
15+
color: inherit;
16+
}
17+
1318
.ui.modal > .close.icon[height="16"] {
1419
top: 0.7em; /* fomantic uses absolute layout, so if we have special icon size, it needs this trick to align vertically */
1520
color: var(--color-text-dark);

0 commit comments

Comments
 (0)