File tree 4 files changed +33
-63
lines changed
4 files changed +33
-63
lines changed Original file line number Diff line number Diff line change 4
4
{{template "repo/settings/navbar" .}}
5
5
<div class="ui container">
6
6
{{template "base/alert" .}}
7
- <div {{if not .HasError}}class="hide"{{end}} id="add-deploy-key-panel">
8
- <h4 class="ui top attached header">
9
- {{.i18n.Tr "repo.settings.add_deploy_key"}}
10
- <div class="ui right">
11
- <button class="ui red tiny hide-panel button" data-panel="#add-deploy-key-panel">
12
- {{.i18n.Tr "cancel"}}
13
- </button>
14
- </div>
15
- </h4>
16
- <div class="ui attached segment">
7
+ <h4 class="ui top attached header">
8
+ {{.i18n.Tr "repo.settings.deploy_keys"}}
9
+ <div class="ui right">
10
+ {{if not .DisableSSH}}
11
+ <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
12
+ {{else}}
13
+ <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
14
+ {{end}}
15
+ </div>
16
+ </h4>
17
+ <div class="ui attached segment">
18
+ <div class="{{if not .HasError}}hide{{end}} mb-4" id="add-deploy-key-panel">
17
19
<form class="ui form" action="{{.Link}}" method="post">
18
20
{{.CsrfTokenHtml}}
19
21
<div class="field">
39
41
<button class="ui green button">
40
42
{{.i18n.Tr "repo.settings.add_deploy_key"}}
41
43
</button>
44
+ <button class="ui hide-panel button" data-panel="#add-deploy-key-panel">
45
+ {{.i18n.Tr "cancel"}}
46
+ </button>
42
47
</form>
43
48
</div>
44
- <br>
45
- </div>
46
- <h4 class="ui top attached header">
47
- {{.i18n.Tr "repo.settings.deploy_keys"}}
48
- <div class="ui right">
49
- {{if not .DisableSSH}}
50
- <div class="ui blue tiny show-panel button" data-panel="#add-deploy-key-panel">{{.i18n.Tr "repo.settings.add_deploy_key"}}</div>
51
- {{else}}
52
- <div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
53
- {{end}}
54
- </div>
55
- </h4>
56
- <div class="ui attached segment">
57
49
{{if .Deploykeys}}
58
50
<div class="ui key list">
59
51
{{range .Deploykeys}}
Original file line number Diff line number Diff line change 1
- <div {{if not .HasGPGError}}class="hide"{{end}} id="add-gpg-key-panel">
2
- <h4 class="ui top attached header">
3
- {{.i18n.Tr "settings.add_new_gpg_key"}}
4
- <div class="ui right">
5
- <button class="ui red tiny hide-panel button" data-panel="#add-gpg-key-panel">
6
- {{.i18n.Tr "cancel"}}
7
- </button>
8
- </div>
9
- </h4>
10
- <div class="ui attached segment">
1
+ <h4 class="ui top attached header">
2
+ {{.i18n.Tr "settings.manage_gpg_keys"}}
3
+ <div class="ui right">
4
+ <div class="ui blue tiny show-panel button" data-panel="#add-gpg-key-panel">{{.i18n.Tr "settings.add_key"}}</div>
5
+ </div>
6
+ </h4>
7
+ <div class="ui attached segment">
8
+ <div class="{{if not .HasGPGError}}hide{{end}} mb-4" id="add-gpg-key-panel">
11
9
<form class="ui form{{if .HasGPGError}} error{{end}}" action="{{.Link}}" method="post">
12
10
{{.CsrfTokenHtml}}
13
11
<input type="hidden" name="title" value="none">
36
34
<button class="ui green button">
37
35
{{.i18n.Tr "settings.add_key"}}
38
36
</button>
37
+ <button class="ui hide-panel button" data-panel="#add-gpg-key-panel">
38
+ {{.i18n.Tr "cancel"}}
39
+ </button>
39
40
</form>
40
41
</div>
41
- </div>
42
- <h4 class="ui top attached header">
43
- {{.i18n.Tr "settings.manage_gpg_keys"}}
44
- <div class="ui right">
45
- <div class="ui blue tiny show-panel button" data-panel="#add-gpg-key-panel">{{.i18n.Tr "settings.add_key"}}</div>
46
- </div>
47
- </h4>
48
- <div class="ui attached segment">
49
- <div class="ui key list">
42
+ <div class="ui key list mt-0">
50
43
<div class="item">
51
44
{{.i18n.Tr "settings.gpg_desc"}}
52
45
</div>
Original file line number Diff line number Diff line change 2
2
{{.i18n.Tr "settings.manage_ssh_keys"}}
3
3
<div class="ui right">
4
4
{{if not .DisableSSH }}
5
- <div id="add-ssh-button" class="ui blue tiny show-panel button" data-toggle-button="#cancel-ssh-button" data- panel="#add-ssh-key-panel">
5
+ <div id="add-ssh-button" class="ui blue tiny show-panel button" data-panel="#add-ssh-key-panel">
6
6
{{.i18n.Tr "settings.add_key"}}
7
7
</div>
8
8
{{else}}
9
9
<div class="ui blue tiny button disabled">{{.i18n.Tr "settings.ssh_disabled"}}</div>
10
10
{{end}}
11
- <button id="cancel-ssh-button" class="ui red tiny hide-panel button" data-toggle-button="#add-ssh-button" data-panel="#add-ssh-key-panel" style="display: none;">
12
- {{.i18n.Tr "cancel"}}
13
- </button>
14
11
</div>
15
12
</h4>
16
13
<div class="ui attached segment">
29
26
<button class="ui green button">
30
27
{{.i18n.Tr "settings.add_key"}}
31
28
</button>
29
+ <button id="cancel-ssh-button" class="ui hide-panel button" data-panel="#add-ssh-key-panel">
30
+ {{.i18n.Tr "cancel"}}
31
+ </button>
32
32
</form>
33
33
</div>
34
34
<div class="ui key list mt-0">
Original file line number Diff line number Diff line change @@ -292,26 +292,11 @@ function handlePanelButtonToggle($btn) {
292
292
293
293
export function initGlobalButtons ( ) {
294
294
$ ( '.show-panel.button' ) . on ( 'click' , function ( ) {
295
- if ( $ ( $ ( this ) . data ( 'panel' ) ) . is ( ":visible" ) ) {
296
- $ ( $ ( this ) . data ( 'panel' ) ) . hide ( ) ;
297
- } else {
298
- $ ( $ ( this ) . data ( 'panel' ) ) . show ( ) ;
299
- }
300
- handlePanelButtonToggle ( $ ( this ) ) ;
295
+ $ ( $ ( this ) . data ( 'panel' ) ) . show ( ) ;
301
296
} ) ;
302
297
303
298
$ ( '.hide-panel.button' ) . on ( 'click' , function ( ) {
304
- if ( $ ( $ ( this ) . data ( 'panel' ) ) . is ( ":visible" ) ) {
305
- $ ( $ ( this ) . data ( 'panel' ) ) . hide ( ) ;
306
- } else {
307
- $ ( $ ( this ) . data ( 'panel' ) ) . show ( ) ;
308
- }
309
- handlePanelButtonToggle ( $ ( this ) ) ;
310
- } ) ;
311
-
312
- $ ( '.swap.button' ) . on ( 'click' , function ( ) {
313
- $ ( $ ( this ) . data ( 'show-button' ) ) . show ( ) ;
314
- $ ( this ) . hide ( ) ;
299
+ $ ( $ ( this ) . data ( 'panel' ) ) . hide ( ) ;
315
300
} ) ;
316
301
317
302
$ ( '.show-modal.button' ) . on ( 'click' , function ( ) {
You can’t perform that action at this time.
0 commit comments