diff --git a/assets/javascripts/wizard/components/wizard-field-upload.js.es6 b/assets/javascripts/wizard/components/wizard-field-upload.js.es6 index f7f82faf..2425fd0a 100644 --- a/assets/javascripts/wizard/components/wizard-field-upload.js.es6 +++ b/assets/javascripts/wizard/components/wizard-field-upload.js.es6 @@ -4,6 +4,7 @@ import { getToken } from "wizard/lib/ajax"; export default Ember.Component.extend({ classNames: ["wizard-field-upload"], uploading: false, + isImage: false, didInsertElement() { this._super(); @@ -30,6 +31,12 @@ export default Ember.Component.extend({ "field.value": response.result, "uploading": false }); + console.log (response.result); + if (['jpg','jpeg','png','gif'].includes(response.result.extension)) { + this.setProperties({ + "isImage": true + }) + } }); $upload.on("fileuploadfail", (e, response) => { diff --git a/assets/javascripts/wizard/templates/components/wizard-field-upload.hbs b/assets/javascripts/wizard/templates/components/wizard-field-upload.hbs index 0e24849a..10e6b0dd 100644 --- a/assets/javascripts/wizard/templates/components/wizard-field-upload.hbs +++ b/assets/javascripts/wizard/templates/components/wizard-field-upload.hbs @@ -11,6 +11,10 @@ {{#if field.value}} - {{field.value.original_filename}} + {{#unless isImage}} + {{field.value.original_filename}} + {{else}} + + {{/unless}} {{/if}}