#48 drop box shape

This commit is contained in:
Karel Picman 2017-07-20 08:40:03 +02:00
parent bf47687615
commit 23176ba0e3
4 changed files with 20 additions and 19 deletions

View File

@ -37,12 +37,9 @@
<%= form_tag({:controller => 'dmsf_upload', :action => 'upload_files', :id => @project, :folder_id => @folder}, <%= form_tag({:controller => 'dmsf_upload', :action => 'upload_files', :id => @project, :folder_id => @folder},
:id => 'uploadform', :method => :post, :multipart => true) do %> :id => 'uploadform', :method => :post, :multipart => true) do %>
<div id="dmsf_uploader"> <div id="dmsf_uploader">
<div class="dmsf_uploader"> <span class="dmsf_uploader">
<p> <%= render :partial => 'dmsf_upload/form', :locals => { :multiple => true, :container => nil } %>
<label><%= l(:label_document_plural) %></label> </span>
<%= render :partial => 'dmsf_upload/form', :locals => { :multiple => true, :container => nil } %>
</p>
</div>
<%= submit_tag l(:label_upload) %> <%= submit_tag l(:label_upload) %>
</div> </div>
<% end %> <% end %>

View File

@ -252,7 +252,7 @@ function dmsfSetupFileDrop() {
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] }; $.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
$('form div.dmsf_uploader').has('input:file').each(function() { $('form span.dmsf_uploader').has('input:file').each(function() {
$(this).on({ $(this).on({
dragover: dmsfDragOverHandler, dragover: dmsfDragOverHandler,
dragleave: dmsfDragOutHandler, dragleave: dmsfDragOutHandler,

View File

@ -310,6 +310,8 @@ div.dmsf_revision_inner_box .attribute .label {
border: 1px solid #e4e4e4; border: 1px solid #e4e4e4;
word-wrap: break-word; word-wrap: break-word;
border-radius: 3px; border-radius: 3px;
min-height: 50px;
display: block;
} }
#dmsf_attachments_fields input.description {margin-left:4px; width:340px;} #dmsf_attachments_fields input.description {margin-left:4px; width:340px;}

View File

@ -53,7 +53,7 @@ module RedmineDmsf
private private
def get_links(container) def get_links(container)
if User.current.allowed_to?(:view_dmsf_files, container.project) && if defined?(container.dmsf_files) && User.current.allowed_to?(:view_dmsf_files, container.project) &&
Setting.plugin_redmine_dmsf['dmsf_act_as_attachable'] && Setting.plugin_redmine_dmsf['dmsf_act_as_attachable'] &&
(container.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS) (container.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS)
links = [] links = []
@ -75,10 +75,12 @@ module RedmineDmsf
def show_thumbnails(container, controller) def show_thumbnails(container, controller)
links = get_links(container) links = get_links(container)
html = controller.send(:render_to_string, if links.present?
{ :partial => 'dmsf_files/thumbnails', html = controller.send(:render_to_string,
:locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} }) { :partial => 'dmsf_files/thumbnails',
html.html_safe :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} })
html.html_safe
end
end end
def attach_documents_form(context) def attach_documents_form(context)
@ -88,13 +90,13 @@ module RedmineDmsf
if User.current.allowed_to?(:file_manipulation, issue.project) && if User.current.allowed_to?(:file_manipulation, issue.project) &&
Setting.plugin_redmine_dmsf['dmsf_act_as_attachable'] && Setting.plugin_redmine_dmsf['dmsf_act_as_attachable'] &&
(issue.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS) (issue.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS)
html = "<div class=\"dmsf_uploader\">" html = '<p>'
html << '<p>' html << "<label>#{l(:label_document_plural)}</label>"
html << "<label>#{l(:label_document_plural)}</label>" html << "<span class=\"dmsf_uploader\">"
html << context[:controller].send(:render_to_string, html << context[:controller].send(:render_to_string,
{ :partial => 'dmsf_upload/form', :locals => { :container => issue, :multiple => true }}) { :partial => 'dmsf_upload/form', :locals => { :container => issue, :multiple => true }})
html << '</span>'
html << '</p>' html << '</p>'
html << '</div>'
html.html_safe html.html_safe
end end
end end
@ -103,7 +105,7 @@ module RedmineDmsf
def show_attached_documents(container, controller) def show_attached_documents(container, controller)
# Add list of attached documents # Add list of attached documents
links = get_links(container) links = get_links(container)
if links.any? if links.present?
unless defined?(EasyExtensions) unless defined?(EasyExtensions)
controller.send(:render_to_string, {:partial => 'dmsf_files/links', controller.send(:render_to_string, {:partial => 'dmsf_files/links',
:locals => { :links => links, :thumbnails => Setting.thumbnails_enabled? }}) :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled? }})