@@ -19,10 +19,13 @@ module.exports = Mn.View.extend({
1919 cancel : 'button.cancel' ,
2020 save : 'button.save' ,
2121 other_certificate : '#other_certificate' ,
22+ other_certificate_label : '#other_certificate_label' ,
2223 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'
2427 } ,
25-
28+
2629 events : {
2730 'click @ui.save' : function ( e ) {
2831 e . preventDefault ( ) ;
@@ -120,9 +123,20 @@ module.exports = Mn.View.extend({
120123 alert ( err . message ) ;
121124 this . ui . buttons . prop ( 'disabled' , false ) . removeClass ( 'btn-disabled' ) ;
122125 } ) ;
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 )
123135 }
124136 } ,
125-
137+ setFileName ( ui , e ) {
138+ this . getUI ( ui ) . text ( e . target . files [ 0 ] . name )
139+ } ,
126140 templateContext : {
127141 getLetsencryptEmail : function ( ) {
128142 return typeof this . meta . letsencrypt_email !== 'undefined' ? this . meta . letsencrypt_email : App . Cache . User . get ( 'email' ) ;
0 commit comments