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 {
7272 Link (
7373 id = " notifications" ,
7474 label = " Notifications" ,
75- path = s " / ${account.userName}/_notifications "
75+ path = s " ${account.userName}/_notifications "
7676 )
7777 }
7878 )
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ trait NotificationsControllerBase extends ControllerBase {
4242 } getOrElse NotFound ()
4343 })
4444
45- post (" /:userName/_notifications" )(oneselfOnly {
45+ ajaxPost (" /:userName/_notifications" )(oneselfOnly {
4646 val userName = params(" userName" )
4747 params.getAs[Boolean ](" disable" ).map { disable =>
4848 updateEmailNotification(userName, disable)
49- redirect( s " / ${userName} /_notifications " )
49+ Ok ( )
5050 } getOrElse NotFound ()
5151 })
5252
Original file line number Diff line number Diff line change 33
44@gitbucket.core.html.main("Notifications"){
55 @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 >
1916 </ div >
20- </ form >
17+ </ div >
2118 }
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