File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ export default Controller.extend({
2121 emailNotificationsError : false ,
2222 emailNotificationsSuccess : false ,
2323
24+ setAllEmailNotifications ( value ) {
25+ this . get ( 'ownedCrates' ) . forEach ( c => {
26+ c . set ( 'email_notifications' , value ) ;
27+ } ) ;
28+ } ,
29+
2430 actions : {
2531 async saveEmailNotifications ( ) {
2632 try {
@@ -45,6 +51,12 @@ export default Controller.extend({
4551 } ) ;
4652 }
4753 } ,
54+ emailNotificationsSelectAll ( ) {
55+ this . setAllEmailNotifications ( true ) ;
56+ } ,
57+ emailNotificationsSelectNone ( ) {
58+ this . setAllEmailNotifications ( false ) ;
59+ } ,
4860 startNewToken ( ) {
4961 this . store . createRecord ( 'api-token' , {
5062 created_at : new Date ( Date . now ( ) + 2000 ) ,
Original file line number Diff line number Diff line change 143143 }
144144 }
145145
146+ .button-container {
147+ margin-right : 1rem ;
148+ }
149+
146150 ul {
147151 padding : 0 ;
148152 @include flex-grow (1 );
Original file line number Diff line number Diff line change 3030
3131 <p >
3232 To aid detection of unauthorized crate changes, we email you each time a new version of a crate you own is pushed.
33- By receiving and reading these emails, you help protect the Rust ecosystem.
33+ By receiving and reading these emails, you help protect the Rust ecosystem. You may also choose to turn these
34+ emails off for any of your crates listed below.
3435 </p >
3536
37+ <div class =' row' >
38+ <div class =' button-container' >
39+ <button type =' button' class =' yellow-button small' {{ action ' emailNotificationsSelectAll' }} >Select All</button >
40+ </div >
41+ <div class =' button-container' >
42+ <button type =' button' class =' yellow-button small' {{ action ' emailNotificationsSelectNone' }} >Deselect All</button >
43+ </div >
44+ </div >
45+
3646 <div class =' row' >
3747 <ul >
3848 {{ #each ownedCrates as |ownedCrate |}}
You can’t perform that action at this time.
0 commit comments