diff --git a/app/views/dmsf_upload/_multi_upload.html.erb b/app/views/dmsf_upload/_multi_upload.html.erb
index 33c4a026..b38e7b50 100644
--- a/app/views/dmsf_upload/_multi_upload.html.erb
+++ b/app/views/dmsf_upload/_multi_upload.html.erb
@@ -37,12 +37,9 @@
<%= form_tag({:controller => 'dmsf_upload', :action => 'upload_files', :id => @project, :folder_id => @folder},
:id => 'uploadform', :method => :post, :multipart => true) do %>
-
-
-
- <%= render :partial => 'dmsf_upload/form', :locals => { :multiple => true, :container => nil } %>
-
-
+
+ <%= render :partial => 'dmsf_upload/form', :locals => { :multiple => true, :container => nil } %>
+
<%= submit_tag l(:label_upload) %>
<% end %>
diff --git a/assets/javascripts/attachments_dmsf.js b/assets/javascripts/attachments_dmsf.js
index eae97df6..912940ae 100644
--- a/assets/javascripts/attachments_dmsf.js
+++ b/assets/javascripts/attachments_dmsf.js
@@ -252,7 +252,7 @@ function dmsfSetupFileDrop() {
$.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({
dragover: dmsfDragOverHandler,
dragleave: dmsfDragOutHandler,
diff --git a/assets/stylesheets/redmine_dmsf.css b/assets/stylesheets/redmine_dmsf.css
index 41754906..b823fd6d 100644
--- a/assets/stylesheets/redmine_dmsf.css
+++ b/assets/stylesheets/redmine_dmsf.css
@@ -310,6 +310,8 @@ div.dmsf_revision_inner_box .attribute .label {
border: 1px solid #e4e4e4;
word-wrap: break-word;
border-radius: 3px;
+ min-height: 50px;
+ display: block;
}
#dmsf_attachments_fields input.description {margin-left:4px; width:340px;}
diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
index ee82c119..cb29ab70 100644
--- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
+++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb
@@ -53,7 +53,7 @@ module RedmineDmsf
private
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'] &&
(container.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS)
links = []
@@ -75,10 +75,12 @@ module RedmineDmsf
def show_thumbnails(container, controller)
links = get_links(container)
- html = controller.send(:render_to_string,
- { :partial => 'dmsf_files/thumbnails',
- :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} })
- html.html_safe
+ if links.present?
+ html = controller.send(:render_to_string,
+ { :partial => 'dmsf_files/thumbnails',
+ :locals => { :links => links, :thumbnails => Setting.thumbnails_enabled?} })
+ html.html_safe
+ end
end
def attach_documents_form(context)
@@ -88,13 +90,13 @@ module RedmineDmsf
if User.current.allowed_to?(:file_manipulation, issue.project) &&
Setting.plugin_redmine_dmsf['dmsf_act_as_attachable'] &&
(issue.project.dmsf_act_as_attachable == Project::ATTACHABLE_DMS_AND_ATTACHMENTS)
- html = ""
- html << '
'
- html << ""
- html << context[:controller].send(:render_to_string,
- { :partial => 'dmsf_upload/form', :locals => { :container => issue, :multiple => true }})
+ html = '
'
+ html << ""
+ html << ""
+ html << context[:controller].send(:render_to_string,
+ { :partial => 'dmsf_upload/form', :locals => { :container => issue, :multiple => true }})
+ html << ''
html << '
'
- html << '
'
html.html_safe
end
end
@@ -103,7 +105,7 @@ module RedmineDmsf
def show_attached_documents(container, controller)
# Add list of attached documents
links = get_links(container)
- if links.any?
+ if links.present?
unless defined?(EasyExtensions)
controller.send(:render_to_string, {:partial => 'dmsf_files/links',
:locals => { :links => links, :thumbnails => Setting.thumbnails_enabled? }})