File tree Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Expand file tree Collapse file tree 4 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 2
2
Template Attributes:
3
3
* locale
4
4
5
- Two buttons:
6
-
5
+ Two buttons (negative, positive):
7
6
* ModalButtonTypes: "yes" (default) or "confirm"
8
- * ModalButtonColors: "green-red " (default) / "blue" / "yellow"
7
+ * ModalButtonColors: "green" (default) / "blue" / "yellow"
9
8
* ModalButtonCancelText
10
9
* ModalButtonOkText
11
10
12
- Single button:
13
-
11
+ Single danger button (GitHub-like):
14
12
* ModalButtonDangerText "This action will destroy your data"
15
13
16
14
The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal internally
@@ -28,16 +26,13 @@ The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal
28
26
{{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}}
29
27
{{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}}
30
28
31
- {{$styleNegative := "red"}}
32
29
{{$stylePositive := "green"}}
33
30
{{if eq .ModalButtonColors "blue"}}
34
- {{$styleNegative = "secondary basic"}}
35
31
{{$stylePositive = "blue"}}
36
32
{{else if eq .ModalButtonColors "yellow"}}
37
- {{$styleNegative = "secondary basic"}}
38
33
{{$stylePositive = "yellow"}}
39
34
{{end}}
40
- <button class="ui {{$styleNegative}} cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
35
+ <button class="ui secondary basic cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button>
41
36
<button class="ui {{$stylePositive}} ok button">{{svg "octicon-check"}} {{$textPositive}}</button>
42
37
{{end}}
43
38
</div>
Original file line number Diff line number Diff line change 38
38
<script type="module">
39
39
for (const el of $('.ui.modal')) {
40
40
const $btn = $('<button>').text(`Show ${el.id}`).on('click', () => {
41
- $(el).modal('show');
41
+ $(el).modal({onApprove() {alert('confirmed');}}).modal( 'show');
42
42
});
43
43
$('.modal-buttons').append($btn);
44
44
}
Original file line number Diff line number Diff line change 1
1
{{template "base/head" .}}
2
- <div role="main" aria-label="{{.Title}}" class="page-content gt-w-screen status-page-500">
2
+ <div role="main" aria-label="{{.Title}}" class="page-content status-page-500">
3
3
<p class="gt-mt-5 center"><img src="{{AssetUrlPrefix}}/img/500.png" alt="Internal Server Error"></p>
4
4
<div class="ui divider"></div>
5
5
Original file line number Diff line number Diff line change 50
50
51
51
.ui .modal .actions > .ui .button .danger {
52
52
display : block;
53
- width : 80 % ;
53
+ width : 100 % ;
54
54
margin : 0 auto;
55
55
text-align : center;
56
56
}
You can’t perform that action at this time.
0 commit comments