diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 64b782835f2..3c1022c6e46 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2927,3 +2927,49 @@ div.ui-widget-overlay { -webkit-border-radius: 3px; border-radius: 3px; } + + + +.openerp .oe_fileuploader { + display: inline-block; + clear: both; +} +.openerp .oe_fileuploader .oe_add { + float: left; + width: 24px; + height: 24px; + position: relative; + left: +2px; + top: +7px; + overflow: hidden; +} +.openerp .oe_fileuploader .oe_add button { + position: absolute; + bottom: +0px; + left: +0px; + height: 24px; + width: 24px; + margin: 0px; + padding: 0px; +} +.openerp .oe_fileuploader .oe_add .oe_hidden_input_file input.oe_form_binary_file { + width: 300px; + left: -100px; + top: 1px; + height: 24px; + width: 300px; + background: transparent; + border: 0; + margin: 0px; + padding: 0px; + color: transparent; +} +.openerp .oe_fileuploader .oe_add button span { + position: relative; + bottom: +4px; + font-size: 30px; +} + +.openerp .oe_fileuploader { + clear: both; +} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f84d30a93ea..1096dd7564d 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2273,6 +2273,65 @@ $sheet-max-width: 860px float: right color: #333 // }}} + +.openerp .oe_fileuploader .oe_add .oe_hidden_input_file input.oe_form_binary_file { + width: 300px; + left: -100px; + top: 1px; + height: 24px; + width: 300px; + background: transparent; + border: 0; + margin: 0px; + padding: 0px; + color: transparent; +} +.openerp .oe_fileuploader .oe_add button span { + position: relative; + bottom: +4px; + font-size: 30px; +} + +.openerp .oe_fileuploader { + clear: both; +} + + .oe_fileuploader + display: inline-block + clear: both + .oe_add + float: left + width: 24px + height: 24px + position: relative + z-index: 10 + left: +2px + top: +7px + overflow: hidden + button + position: absolute + bottom: +0px + left: +0px + height: 24px + width: 24px + margin: 0px + padding: 0px + input.oe_form_binary_file + width: 300px + left: -100px + top: 1px + height: 24px + width: 300px + background: transparent + border: 0 + margin: 0px + padding: 0px + color: transparent + button span + position: relative + bottom: +4px + font-size: 30px + // Kitten Mode {{{ .kitten-mode-activated background-image: url(http://placekitten.com/g/1365/769) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 0d28bd410fc..08240456b37 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4918,6 +4918,7 @@ instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractFiel this._super(this); this.$list_file = this.$('.oe_placeholder_files'); this.$el.on('change', 'input.oe_form_binary_file', this.on_file_change ); + this.display_files(); }, set_value: function(value_) { var values = this.files = (value_ && !this.files) ? value_ : this.files; @@ -4934,8 +4935,8 @@ instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractFiel if(this.$list_file) { var render = $(instance.web.qweb.render('FieldBinaryFileUploader.files', {'widget': this})); this.$list_file.replaceWith( render ); - this.$list_file = this.$(".oe_fileuploader_files"); - this.$list_file.on('click', '.oe_fileuploader_delete', this.on_file_delete); + this.$list_file = this.$(".oe_files"); + this.$list_file.on('click', '.oe_delete', this.on_file_delete); } }, on_file_change: function (event) { @@ -4966,9 +4967,11 @@ instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractFiel instance.web.blockUI(); } + // TODO : unactivate send on wizard and form + // submit file - self.$('form.oe_form_binary_form').submit(); - this.$(".oe_fileuploader_form").hide(); + this.$('form.oe_form_binary_form').submit(); + this.$(".oe_fileuploader").hide(); // add file on result this.files.push({ @@ -4987,6 +4990,8 @@ instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractFiel instance.web.unblockUI(); } + // TODO : activate send on wizard and form + for(var i in this.files){ if(this.files[i].filename == result.filename && this.files[i].upload) { this.files[i] = { @@ -5001,7 +5006,7 @@ instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractFiel var $input = this.$('input.oe_form_binary_file'); $input.after($input.clone(true)).remove(); - this.$(".oe_fileuploader_form").show(); + this.$(".oe_fileuploader").show(); }, on_file_delete: function (event) { event.stopPropagation(); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 639501e286e..f2f9e0f4989 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1175,7 +1175,7 @@ -