drag/drop feature for new content #443

This commit is contained in:
Karel Picman 2016-08-23 14:16:27 +02:00
parent b03a69e87c
commit 6aae60cff6

View File

@ -21,11 +21,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<div class="box">
<%= form_tag({:controller => 'dmsf_upload', :action => 'upload_files', :id => @project, :folder_id => @folder},
:id => 'uploadform', :method => :post, :multipart => true) do %>
<div class="dmsf_upload_select">
<div class="dmsf_upload_select">
<select id="uploader_select">
<option value="1">
<%= l(:label_drag_drop) %>
@ -34,17 +30,22 @@
<%= l(:label_classic) %>
</option>
</select>
</div>
<h3><%= l(:label_upload) %></h3>
</div>
<h3><%= l(:label_upload) %></h3>
<%= form_tag({:controller => 'dmsf_upload', :action => 'upload_files', :id => @project, :folder_id => @folder},
:id => 'uploadform', :method => :post, :multipart => true) do %>
<div id="uploader">
<div class="box">
<p>
<label><%= l(:label_attachment_plural) %></label>
<%= render :partial => 'attachments/form' %>
</p>
</div>
<%= submit_tag l(:label_upload) %>
</div>
<% end %>
</div>
<% end %>
<script type="text/javascript">
var originalUploaderContent;
@ -55,6 +56,7 @@
$('#uploader_select').change(function() {
if($(this).val() === '2') {
uploader.html(originalUploaderContent);
setupFileDrop();
} else {
initPlUploader(uploader);
}