d9af6f79ed
Dynamically adjust placedholder for uploads and fix Dropzone event handlers Override error handler to prevent error messages from being inserted underneath image preview Fix tests Use regexp instead of startsWith for better browser compatibility Remove duplicate code in _replace.html.haml and use one template Remove files upon error and retain alert messages until user adds a new file
28 lines
1.2 KiB
Text
28 lines
1.2 KiB
Text
#modal-upload-blob.modal
|
||
.modal-dialog
|
||
.modal-content
|
||
.modal-header
|
||
%a.close{href: "#", "data-dismiss" => "modal"} ×
|
||
%h3.page-title #{@title}
|
||
%p.light
|
||
From branch
|
||
%strong= @ref
|
||
.modal-body
|
||
= form_tag @form_path, method: @method, class: 'blob-file-upload-form-js form-horizontal' do
|
||
.dropzone
|
||
.dropzone-previews.blob-upload-dropzone-previews
|
||
%p.dz-message.light
|
||
Attach a file by drag & drop or
|
||
= link_to 'click to upload', '#', class: "markdown-selector"
|
||
%br
|
||
.dropzone-alerts{class: "alert alert-danger data", style: "display:none"}
|
||
= render 'shared/commit_message_container', params: params,
|
||
placeholder: @placeholder
|
||
.form-group
|
||
.col-sm-offset-2.col-sm-10
|
||
= button_tag @button_title, class: 'btn btn-small btn-primary btn-upload-file', id: 'submit-all'
|
||
= link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"
|
||
|
||
:coffeescript
|
||
disableButtonIfEmptyField $('.blob-file-upload-form-js').find('#commit_message'), '.btn-upload-file'
|
||
new BlobFileDropzone($('.blob-file-upload-form-js'), '#{@method}')
|