File tree 3 files changed +27
-1
lines changed
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({
21
21
emailNotificationsError : false ,
22
22
emailNotificationsSuccess : false ,
23
23
24
+ setAllEmailNotifications ( value ) {
25
+ this . get ( 'ownedCrates' ) . forEach ( c => {
26
+ c . set ( 'email_notifications' , value ) ;
27
+ } ) ;
28
+ } ,
29
+
24
30
actions : {
25
31
async saveEmailNotifications ( ) {
26
32
try {
@@ -45,6 +51,12 @@ export default Controller.extend({
45
51
} ) ;
46
52
}
47
53
} ,
54
+ emailNotificationsSelectAll ( ) {
55
+ this . setAllEmailNotifications ( true ) ;
56
+ } ,
57
+ emailNotificationsSelectNone ( ) {
58
+ this . setAllEmailNotifications ( false ) ;
59
+ } ,
48
60
startNewToken ( ) {
49
61
this . store . createRecord ( 'api-token' , {
50
62
created_at : new Date ( Date . now ( ) + 2000 ) ,
Original file line number Diff line number Diff line change 143
143
}
144
144
}
145
145
146
+ .button-container {
147
+ margin-right : 1rem ;
148
+ }
149
+
146
150
ul {
147
151
padding : 0 ;
148
152
@include flex-grow (1 );
Original file line number Diff line number Diff line change 30
30
31
31
<p >
32
32
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.
34
35
</p >
35
36
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
+
36
46
<div class =' row' >
37
47
<ul >
38
48
{{ #each ownedCrates as |ownedCrate |}}
You can’t perform that action at this time.
0 commit comments