@@ -19,10 +19,13 @@ module.exports = Mn.View.extend({
19
19
cancel : 'button.cancel' ,
20
20
save : 'button.save' ,
21
21
other_certificate : '#other_certificate' ,
22
+ other_certificate_label : '#other_certificate_label' ,
22
23
other_certificate_key : '#other_certificate_key' ,
23
- other_intermediate_certificate : '#other_intermediate_certificate'
24
+ other_certificate_key_label : '#other_certificate_key_label' ,
25
+ other_intermediate_certificate : '#other_intermediate_certificate' ,
26
+ other_intermediate_certificate_label : '#other_intermediate_certificate_label'
24
27
} ,
25
-
28
+
26
29
events : {
27
30
'click @ui.save' : function ( e ) {
28
31
e . preventDefault ( ) ;
@@ -120,9 +123,20 @@ module.exports = Mn.View.extend({
120
123
alert ( err . message ) ;
121
124
this . ui . buttons . prop ( 'disabled' , false ) . removeClass ( 'btn-disabled' ) ;
122
125
} ) ;
126
+ } ,
127
+ 'change @ui.other_certificate_key' : function ( e ) {
128
+ this . setFileName ( "other_certificate_key_label" , e )
129
+ } ,
130
+ 'change @ui.other_certificate' : function ( e ) {
131
+ this . setFileName ( "other_certificate_label" , e )
132
+ } ,
133
+ 'change @ui.other_intermediate_certificate' : function ( e ) {
134
+ this . setFileName ( "other_intermediate_certificate_label" , e )
123
135
}
124
136
} ,
125
-
137
+ setFileName ( ui , e ) {
138
+ this . getUI ( ui ) . text ( e . target . files [ 0 ] . name )
139
+ } ,
126
140
templateContext : {
127
141
getLetsencryptEmail : function ( ) {
128
142
return typeof this . meta . letsencrypt_email !== 'undefined' ? this . meta . letsencrypt_email : App . Cache . User . get ( 'email' ) ;
0 commit comments