File tree Expand file tree Collapse file tree 3 files changed +22
-18
lines changed
gitbucket/notifications/controller
twirl/gitbucket/notifications Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ class Plugin extends gitbucket.core.plugin.Plugin {
72
72
Link (
73
73
id = " notifications" ,
74
74
label = " Notifications" ,
75
- path = s " / ${account.userName}/_notifications "
75
+ path = s " ${account.userName}/_notifications "
76
76
)
77
77
}
78
78
)
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ trait NotificationsControllerBase extends ControllerBase {
42
42
} getOrElse NotFound ()
43
43
})
44
44
45
- post (" /:userName/_notifications" )(oneselfOnly {
45
+ ajaxPost (" /:userName/_notifications" )(oneselfOnly {
46
46
val userName = params(" userName" )
47
47
params.getAs[Boolean ](" disable" ).map { disable =>
48
48
updateEmailNotification(userName, disable)
49
- redirect( s " / ${userName} /_notifications " )
49
+ Ok ( )
50
50
} getOrElse NotFound ()
51
51
})
52
52
Original file line number Diff line number Diff line change 3
3
4
4
@gitbucket.core.html.main("Notifications"){
5
5
@gitbucket.core.account.html.menu("notifications", account.userName, account.isGroupAccount){
6
- < form method ="POST " action ="@context.path/@account.userName/_notifications ">
7
- < div class ="panel panel-default ">
8
- < div class ="panel-heading strong "> Email notification preferences</ div >
9
- < div class ="panel-body ">
10
- < fieldset class ="form-group ">
11
- < p class ="muted "> If checked, never be notified of anything.</ p >
12
- < label for ="disable ">
13
- < input type ="checkbox " name ="disable " id ="disable " value ="true " @if(disableEmail){checked} />
14
- Disable
15
- </ label >
16
- </ fieldset >
17
- < input type ="submit " class ="btn btn-success " value ="Save "/>
18
- </ div >
6
+ < div class ="panel panel-default ">
7
+ < div class ="panel-heading strong "> Email notification preferences</ div >
8
+ < div class ="panel-body ">
9
+ < fieldset class ="form-group ">
10
+ < p class ="muted "> If checked, never be notified of anything.</ p >
11
+ < label for ="disable ">
12
+ < input type ="checkbox " name ="disable " id ="disable " value ="true " @if(disableEmail){checked} />
13
+ Disable
14
+ </ label >
15
+ </ fieldset >
19
16
</ div >
20
- </ form >
17
+ </ div >
21
18
}
22
- }
19
+ }
20
+ < script >
21
+ $ ( function ( ) {
22
+ $ ( '#disable' ) . click ( function ( ) {
23
+ $ . post ( '@context.path/@account.userName/_notifications' , { 'disable' : this . checked } ) ;
24
+ } ) ;
25
+ } ) ;
26
+ </ script >
You can’t perform that action at this time.
0 commit comments