diff --git a/Gemfile.lock b/Gemfile.lock
index 5cbb357e..ee6ba77e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- binda (0.0.8.beta.1)
+ binda (0.0.8.beta.3)
aasm (>= 4.11, < 4.13)
ancestry (>= 2.1, < 3.1)
carrierwave (>= 0.10, < 1.12)
diff --git a/app/assets/javascripts/binda/components/fileupload_custom_script.js b/app/assets/javascripts/binda/components/fileupload_custom_script.js
new file mode 100644
index 00000000..cf42fefe
--- /dev/null
+++ b/app/assets/javascripts/binda/components/fileupload_custom_script.js
@@ -0,0 +1,90 @@
+
+export function custom_fileupload ( target ) {
+
+ let $this = $( target )
+ $this.fileupload({
+
+ url: $this.data('url'), // This should return json, not a proper page
+ dropZone: $this,
+ dataType: 'json',
+ autoUpload: true,
+ acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
+ maxFileSize: 999000,
+ // Enable image resizing, except for Android and Opera,
+ // which actually support image resizing, but fail to
+ // send Blob objects via XHR requests:
+ disableImageResize: /Android(?!.*Chrome)|Opera/
+ .test(window.navigator.userAgent),
+ previewMaxWidth: 100,
+ previewMaxHeight: 100,
+ previewCrop: true
+
+ }).on('fileuploadadd', function (e, data) {
+
+ data.context = $this.find('.details');
+ $.each(data.files, function (index, file) {
+ $this.find('.fileupload--filename').text(file.name)
+ });
+ $this.find('.fileupload--details').removeClass('fileupload--details--hidden')
+
+ }).on('fileuploadprocessalways', function (e, data) {
+
+ var index = data.index,
+ file = data.files[index],
+ node = $(data.context.children()[index]);
+ if (file.error) {
+ node
+ .append('
')
+ .append($('').text(file.error));
+ }
+ if (index + 1 === data.files.length) {
+ data.context.find('button')
+ .text('Upload')
+ .prop('disabled', !!data.files.error);
+ }
+
+ }).on('fileuploadprogressall', function (e, data) {
+
+ var progress = parseInt(data.loaded / data.total * 100, 10);
+ console.log(progress)
+ $this.find('.progress .progress-bar').css(
+ 'width',
+ progress + '%'
+ )
+
+ }).on('fileuploaddone', function (e, data) {
+
+ $.each(data.result.files, function (index, file) {
+ if (file.url) {
+ setTimeout( function() {
+ // remove context
+ data.context.remove()
+ // reset progress bar
+ $this.find('.progress .progress-bar').css('width', '0%')
+ // append/replace image
+ $this.find('.form-item--asset--image').attr('src', file.url).attr('alt', file.name)
+ $this.find('.fileupload--remove-image-btn').removeClass('invisible')
+ }, 500 ) // this 500ms of timeout is based on a .2s CSS transition. See fileupload stylesheets
+ setTimeout( function() {
+ $this.find('.fileupload--details').addClass('fileupload--details--hidden')
+ }, 300 )
+ } else if (file.error) {
+ var error = $('').text(file.error);
+ $(data.context.children()[index])
+ .append('
')
+ .append(error);
+ }
+ });
+
+ }).on('fileuploadfail', function (e, data) {
+
+ $.each(data.files, function (index) {
+ var error = $('').text('File upload failed.');
+ $(data.context.children()[index])
+ .append('
')
+ .append(error);
+ });
+
+ }).prop('disabled', !$.support.fileInput)
+ .parent().addClass($.support.fileInput ? undefined : 'disabled');
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/binda/components/form_item_asset.js b/app/assets/javascripts/binda/components/form_item_asset.js
index 5bad01e5..69a2711d 100644
--- a/app/assets/javascripts/binda/components/form_item_asset.js
+++ b/app/assets/javascripts/binda/components/form_item_asset.js
@@ -2,6 +2,8 @@
/// FORM ITEM ASSET
///- - - - - - - - - - - - - - - - - - - -
+import { custom_fileupload } from './fileupload_custom_script'
+
class FormItemAsset
{
constructor()
@@ -17,114 +19,7 @@ class FormItemAsset
setEvents()
{
- this.setupFileUpload()
- }
-
- setupFileUpload()
- {
- var uploadButton = $('')
- .addClass('btn btn-primary')
- .prop('disabled', true)
- .text('Processing...')
- .on('click', function () {
- var $this = $(this),
- data = $this.data();
- $this
- .off('click')
- .text('Abort')
- .on('click', function () {
- $this.remove();
- data.abort();
- });
- data.submit().always(function () {
- $this.remove();
- });
- });
- $('.fileupload').each(function () {
-
- let $this = $(this)
- $(this).fileupload({
-
- url: $this.data('url'), // This should return json, not a proper page
- dropZone: $this,
- dataType: 'json',
- autoUpload: true,
- acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
- maxFileSize: 999000,
- // Enable image resizing, except for Android and Opera,
- // which actually support image resizing, but fail to
- // send Blob objects via XHR requests:
- disableImageResize: /Android(?!.*Chrome)|Opera/
- .test(window.navigator.userAgent),
- previewMaxWidth: 100,
- previewMaxHeight: 100,
- previewCrop: true
- }).on('fileuploadadd', function (e, data) {
-
- data.context = $this.find('.details');
- $.each(data.files, function (index, file) {
- $this.find('.fileupload--filename').text(file.name)
- });
- $this.find('.fileupload--details').removeClass('fileupload--details--hidden')
- }).on('fileuploadprocessalways', function (e, data) {
-
- var index = data.index,
- file = data.files[index],
- node = $(data.context.children()[index]);
- if (file.error) {
- node
- .append('
')
- .append($('').text(file.error));
- }
- if (index + 1 === data.files.length) {
- data.context.find('button')
- .text('Upload')
- .prop('disabled', !!data.files.error);
- }
- }).on('fileuploadprogressall', function (e, data) {
-
- var progress = parseInt(data.loaded / data.total * 100, 10);
- console.log(progress)
- $this.find('.progress .progress-bar').css(
- 'width',
- progress + '%'
- )
- }).on('fileuploaddone', function (e, data) {
-
- console.log(data)
-
- $.each(data.result.files, function (index, file) {
- if (file.url) {
- setTimeout( function() {
- // remove context
- data.context.remove()
- // reset progress bar
- $this.find('.progress .progress-bar').css('width', '0%')
- // append/replace image
- $this.find('.form-item--asset--image').attr('src', file.url).attr('alt', file.name)
- $this.find('.fileupload--remove-image-btn').removeClass('invisible')
- }, 500 ) // this 500ms of timeout is based on a .2s CSS transition. See fileupload stylesheets
- setTimeout( function() {
- $this.find('.fileupload--details').addClass('fileupload--details--hidden')
- }, 300 )
- } else if (file.error) {
- var error = $('').text(file.error);
- $(data.context.children()[index])
- .append('
')
- .append(error);
- }
- });
- }).on('fileuploadfail', function (e, data) {
-
- $.each(data.files, function (index) {
- var error = $('').text('File upload failed.');
- $(data.context.children()[index])
- .append('
')
- .append(error);
- });
- }).prop('disabled', !$.support.fileInput)
- .parent().addClass($.support.fileInput ? undefined : 'disabled');
- });
+ $('.fileupload').each( function () { custom_fileupload( this ) });
}
}
diff --git a/app/assets/javascripts/binda/components/form_item_repeater.js b/app/assets/javascripts/binda/components/form_item_repeater.js
index 2fdd8b4f..37e1262a 100644
--- a/app/assets/javascripts/binda/components/form_item_repeater.js
+++ b/app/assets/javascripts/binda/components/form_item_repeater.js
@@ -2,6 +2,7 @@
/// FORM ITEM
///- - - - - - - - - - - - - - - - - - - -
+import { custom_fileupload } from './fileupload_custom_script'
import { _FormItemEditor } from './form_item_editor'
class FormItemRepeater {
@@ -34,6 +35,8 @@ class FormItemRepeater {
// Stop default behaviour
event.preventDefault()
+ if ( !confirm("Are you sure you want do delete it?") ) return
+
$.ajax({
url: $( this ).attr('href'),
data: { id: $( this ).data('id'), isAjax: true },
@@ -69,5 +72,6 @@ function addNewItem( event )
var editor_id = $list.find('textarea').last('textarea').attr('id')
tinyMCE.EditorManager.execCommand('mceAddEditor',true, editor_id);
_FormItemEditor.resize()
+ custom_fileupload( $list.find('.fileupload').last('.fileupload').get(0) );
})
}
\ No newline at end of file
diff --git a/app/assets/javascripts/binda/dist/binda.bundle.js b/app/assets/javascripts/binda/dist/binda.bundle.js
index cbef91c6..ff61ce4f 100644
--- a/app/assets/javascripts/binda/dist/binda.bundle.js
+++ b/app/assets/javascripts/binda/dist/binda.bundle.js
@@ -212,6 +212,7 @@ function addNewItem(event) {
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fileupload_custom_script__ = __webpack_require__(7);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _FormItemAsset; });
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
@@ -221,6 +222,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/// FORM ITEM ASSET
///- - - - - - - - - - - - - - - - - - - -
+
+
var FormItemAsset = function () {
function FormItemAsset() {
_classCallCheck(this, FormItemAsset);
@@ -240,93 +243,8 @@ var FormItemAsset = function () {
}, {
key: 'setEvents',
value: function setEvents() {
- this.setupFileUpload();
- }
- }, {
- key: 'setupFileUpload',
- value: function setupFileUpload() {
- var uploadButton = $('').addClass('btn btn-primary').prop('disabled', true).text('Processing...').on('click', function () {
- var $this = $(this),
- data = $this.data();
- $this.off('click').text('Abort').on('click', function () {
- $this.remove();
- data.abort();
- });
- data.submit().always(function () {
- $this.remove();
- });
- });
$('.fileupload').each(function () {
-
- var $this = $(this);
- $(this).fileupload({
-
- url: $this.data('url'), // This should return json, not a proper page
- dropZone: $this,
- dataType: 'json',
- autoUpload: true,
- acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
- maxFileSize: 999000,
- // Enable image resizing, except for Android and Opera,
- // which actually support image resizing, but fail to
- // send Blob objects via XHR requests:
- disableImageResize: /Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent),
- previewMaxWidth: 100,
- previewMaxHeight: 100,
- previewCrop: true
- }).on('fileuploadadd', function (e, data) {
-
- data.context = $this.find('.details');
- $.each(data.files, function (index, file) {
- $this.find('.fileupload--filename').text(file.name);
- });
- $this.find('.fileupload--details').removeClass('fileupload--details--hidden');
- }).on('fileuploadprocessalways', function (e, data) {
-
- var index = data.index,
- file = data.files[index],
- node = $(data.context.children()[index]);
- if (file.error) {
- node.append('
').append($('').text(file.error));
- }
- if (index + 1 === data.files.length) {
- data.context.find('button').text('Upload').prop('disabled', !!data.files.error);
- }
- }).on('fileuploadprogressall', function (e, data) {
-
- var progress = parseInt(data.loaded / data.total * 100, 10);
- console.log(progress);
- $this.find('.progress .progress-bar').css('width', progress + '%');
- }).on('fileuploaddone', function (e, data) {
-
- console.log(data);
-
- $.each(data.result.files, function (index, file) {
- if (file.url) {
- setTimeout(function () {
- // remove context
- data.context.remove();
- // reset progress bar
- $this.find('.progress .progress-bar').css('width', '0%');
- // append/replace image
- $this.find('.form-item--asset--image').attr('src', file.url).attr('alt', file.name);
- $this.find('.fileupload--remove-image-btn').removeClass('invisible');
- }, 500); // this 500ms of timeout is based on a .2s CSS transition. See fileupload stylesheets
- setTimeout(function () {
- $this.find('.fileupload--details').addClass('fileupload--details--hidden');
- }, 300);
- } else if (file.error) {
- var error = $('').text(file.error);
- $(data.context.children()[index]).append('
').append(error);
- }
- });
- }).on('fileuploadfail', function (e, data) {
-
- $.each(data.files, function (index) {
- var error = $('').text('File upload failed.');
- $(data.context.children()[index]).append('
').append(error);
- });
- }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
+ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__fileupload_custom_script__["a" /* custom_fileupload */])(this);
});
}
}]);
@@ -416,7 +334,8 @@ var _FormItemChoice = new FormItemChoice();
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__form_item_editor__ = __webpack_require__(0);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fileupload_custom_script__ = __webpack_require__(7);
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__form_item_editor__ = __webpack_require__(0);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _FormItemRepeater; });
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
@@ -428,6 +347,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
+
var FormItemRepeater = function () {
function FormItemRepeater() {
_classCallCheck(this, FormItemRepeater);
@@ -453,7 +373,7 @@ var FormItemRepeater = function () {
// Stop default behaviour
event.preventDefault();
$(this).parent(this.target).remove();
- __WEBPACK_IMPORTED_MODULE_0__form_item_editor__["a" /* _FormItemEditor */].resize();
+ __WEBPACK_IMPORTED_MODULE_1__form_item_editor__["a" /* _FormItemEditor */].resize();
});
$(document).on('click', '.form-item--delete-repeater-item', function (event) {
@@ -462,13 +382,15 @@ var FormItemRepeater = function () {
// Stop default behaviour
event.preventDefault();
+ if (!confirm("Are you sure you want do delete it?")) return;
+
$.ajax({
url: $(this).attr('href'),
data: { id: $(this).data('id'), isAjax: true },
method: "DELETE"
}).done(function () {
$(_this).parents('.form-item--repeater').remove();
- __WEBPACK_IMPORTED_MODULE_0__form_item_editor__["a" /* _FormItemEditor */].resize();
+ __WEBPACK_IMPORTED_MODULE_1__form_item_editor__["a" /* _FormItemEditor */].resize();
});
});
}
@@ -496,7 +418,8 @@ function addNewItem(event) {
$list.append(newRepeater);
var editor_id = $list.find('textarea').last('textarea').attr('id');
tinyMCE.EditorManager.execCommand('mceAddEditor', true, editor_id);
- __WEBPACK_IMPORTED_MODULE_0__form_item_editor__["a" /* _FormItemEditor */].resize();
+ __WEBPACK_IMPORTED_MODULE_1__form_item_editor__["a" /* _FormItemEditor */].resize();
+ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__fileupload_custom_script__["a" /* custom_fileupload */])($list.find('.fileupload').last('.fileupload').get(0));
});
}
@@ -585,5 +508,84 @@ $(document).ready(function () {
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__components_sortable__["a" /* default */])();
});
+/***/ }),
+/* 7 */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* harmony export (immutable) */ __webpack_exports__["a"] = custom_fileupload;
+
+function custom_fileupload(target) {
+
+ var $this = $(target);
+ $this.fileupload({
+
+ url: $this.data('url'), // This should return json, not a proper page
+ dropZone: $this,
+ dataType: 'json',
+ autoUpload: true,
+ acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
+ maxFileSize: 999000,
+ // Enable image resizing, except for Android and Opera,
+ // which actually support image resizing, but fail to
+ // send Blob objects via XHR requests:
+ disableImageResize: /Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent),
+ previewMaxWidth: 100,
+ previewMaxHeight: 100,
+ previewCrop: true
+
+ }).on('fileuploadadd', function (e, data) {
+
+ data.context = $this.find('.details');
+ $.each(data.files, function (index, file) {
+ $this.find('.fileupload--filename').text(file.name);
+ });
+ $this.find('.fileupload--details').removeClass('fileupload--details--hidden');
+ }).on('fileuploadprocessalways', function (e, data) {
+
+ var index = data.index,
+ file = data.files[index],
+ node = $(data.context.children()[index]);
+ if (file.error) {
+ node.append('
').append($('').text(file.error));
+ }
+ if (index + 1 === data.files.length) {
+ data.context.find('button').text('Upload').prop('disabled', !!data.files.error);
+ }
+ }).on('fileuploadprogressall', function (e, data) {
+
+ var progress = parseInt(data.loaded / data.total * 100, 10);
+ console.log(progress);
+ $this.find('.progress .progress-bar').css('width', progress + '%');
+ }).on('fileuploaddone', function (e, data) {
+
+ $.each(data.result.files, function (index, file) {
+ if (file.url) {
+ setTimeout(function () {
+ // remove context
+ data.context.remove();
+ // reset progress bar
+ $this.find('.progress .progress-bar').css('width', '0%');
+ // append/replace image
+ $this.find('.form-item--asset--image').attr('src', file.url).attr('alt', file.name);
+ $this.find('.fileupload--remove-image-btn').removeClass('invisible');
+ }, 500); // this 500ms of timeout is based on a .2s CSS transition. See fileupload stylesheets
+ setTimeout(function () {
+ $this.find('.fileupload--details').addClass('fileupload--details--hidden');
+ }, 300);
+ } else if (file.error) {
+ var error = $('').text(file.error);
+ $(data.context.children()[index]).append('
').append(error);
+ }
+ });
+ }).on('fileuploadfail', function (e, data) {
+
+ $.each(data.files, function (index) {
+ var error = $('').text('File upload failed.');
+ $(data.context.children()[index]).append('
').append(error);
+ });
+ }).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
+}
+
/***/ })
/******/ ]);
\ No newline at end of file
diff --git a/app/assets/stylesheets/binda/components/sortable.scss b/app/assets/stylesheets/binda/components/sortable.scss
index 50be8f5c..9cd4640d 100644
--- a/app/assets/stylesheets/binda/components/sortable.scss
+++ b/app/assets/stylesheets/binda/components/sortable.scss
@@ -1,102 +1,111 @@
ul.sortable,
-ul#sortable {
- list-style-type: none;
- padding-left: 0;
+ul#sortable
+{
margin-bottom: 64px;
-
- li {
+ padding-left: 0;
+ list-style-type: none;
+ li
+ {
position: relative;
- margin-top: 0px;
- margin-bottom: 0px;
- padding: 8px;
- margin-bottom: 8px;
- background-color: #FFF;
- border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
- box-shadow: 0px 0px 0px 0px rgba(0,0,0,0.25);
z-index: 0;
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-bottom: 8px;
+ padding: 8px;
cursor: move;
- transition: box-shadow 0.3s ease-in-out;
-
- &:hover {
- box-shadow: 0px 10px 26px 0px rgba(0,0,0,0.25);
+ transition: box-shadow .3s ease-in-out;
+ border-bottom: 1px solid rgba( 0, 0, 0, .1 );
+ background-color: #fff;
+ box-shadow: 0 0 0 0 rgba(0,0,0,.25);
+ &:hover
+ {
// margin-top: -10px;
// margin-bottom: 10px;
// top: -10px;
z-index: 10;
+ box-shadow: 0 10px 26px 0 rgba(0,0,0,.25);
}
-
- &:first-child {
- border-top: 1px solid rgba( 0, 0, 0, 0.1 );
+ &:first-child
+ {
+ border-top: 1px solid rgba( 0, 0, 0, .1 );
}
-
- img {
- max-height: 64px;
+ img
+ {
width: auto;
+ max-height: 64px;
margin-right: 32px;
}
}
}
-ul#sortable > li > * ,
-ul.sortable > li > * {
+
+.sortable-placeholder
+{
+ height: 48px;
+}
+
+.ui-state-highlight
+{
+ height: 48px;
+ background-color: #e2e2e2;
+}
+
+ul#sortable > li > *,
+ul.sortable > li > *
+{
display: inline-block;
}
-.sortable-handle {
+.sortable-handle
+{
width: 12px;
height: 12px;
- margin-left: 8px;
margin-right: 16px;
+ margin-left: 8px;
border-radius: 6px;
- background-color: #CCC;
-}
-
-.ui-state-highlight {
- height: 64px;
- background-color: #E2E2E2;
+ background-color: #ccc;
}
tbody#sortable,
-tbody.sortable {
- list-style-type: none;
- padding-left: 0;
+tbody.sortable
+{
margin-bottom: 64px;
-
- tr {
- padding-bottom: 8px;
+ padding-left: 0;
+ list-style-type: none;
+ tr
+ {
margin-bottom: 8px;
- border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
-
- &:first-child {
- padding-top: 8px;
- border-top: 1px solid rgba( 0, 0, 0, 0.1 );
+ padding-bottom: 8px;
+ border-bottom: 1px solid rgba( 0, 0, 0, .1 );
+ &:first-child
+ {
+ // padding-top: 8px;
+ // border-top: 1px solid rgba( 0, 0, 0, .1 );
}
-
- img {
- max-height: 64px;
+ img
+ {
width: auto;
+ max-height: 64px;
margin-right: 32px;
}
}
-
- &.sortable--no-handle {
- tr {
+ &.sortable--no-handle
+ {
+ tr
+ {
cursor: move;
}
}
}
-.sortable-placeholder {
- height: 48px;
-}
-
-.sortable--handle {
+.sortable--handle
+{
display: inline-block;
width: 12px;
height: 12px;
- margin-left: 8px;
margin-right: 16px;
- border-radius: 6px;
- background-color: #CCC;
+ margin-left: 8px;
cursor: move;
-}
\ No newline at end of file
+ border-radius: 6px;
+ background-color: #ccc;
+}
diff --git a/app/controllers/binda/components_controller.rb b/app/controllers/binda/components_controller.rb
index e5fa98a4..c5768796 100644
--- a/app/controllers/binda/components_controller.rb
+++ b/app/controllers/binda/components_controller.rb
@@ -73,7 +73,7 @@ def sort
def upload
if @component.update( upload_params(:component) )
respond_to do |format|
- format.json { render json: upload_details_for }
+ format.json { render json: upload_details }
end
else
logger.debug("The upload process has failed. #{ @component.errors }")
diff --git a/app/views/binda/fieldable/_form_item_new_repeater.html.erb b/app/views/binda/fieldable/_form_item_new_repeater.html.erb
index 01b5a22e..c7919e03 100644
--- a/app/views/binda/fieldable/_form_item_new_repeater.html.erb
+++ b/app/views/binda/fieldable/_form_item_new_repeater.html.erb
@@ -1,7 +1,7 @@
<%# - - - - - - - - - - - - - - %>
<%# REPEATER NEW FIELDS %>
<%# - - - - - - - - - - - - - - %>
-<%= simple_form_for [@instance.structure, @instance], defaults: { label: false } do |f| %>
+<%= simple_form_for [@instance.structure, @instance], defaults: { label: false }, html: { multipart: true } do |f| %>