From b1ce56a0e61a6dc0319d02fc69f50dcfcd4c32c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 24 May 2022 13:30:51 +0200 Subject: [PATCH] Revert "#1353 doc preview" This reverts commit 6f8d73ab8bb8dd3acfd0aee15474f287e4e1126b. --- app/controllers/dmsf_upload_controller.rb | 1 - app/models/dmsf_file.rb | 2 +- app/views/dmsf/_main.html.erb | 4 --- app/views/dmsf_upload/upload_files.html.erb | 3 +- progress.patch | 38 --------------------- 5 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 progress.patch diff --git a/app/controllers/dmsf_upload_controller.rb b/app/controllers/dmsf_upload_controller.rb index 2515b47a..b2590f23 100644 --- a/app/controllers/dmsf_upload_controller.rb +++ b/app/controllers/dmsf_upload_controller.rb @@ -132,7 +132,6 @@ class DmsfUploadController < ApplicationController def commit_files_internal(commited_files) @files, failed_uploads = DmsfUploadHelper.commit_files_internal(commited_files, @project, @folder, self) - call_hook(:dmsf_upload_controller_after_commit, { files: @files }) respond_to do |format| format.js format.api { render_validation_errors(failed_uploads) unless failed_uploads.empty? } diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 28ff9a8b..38c39748 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -524,7 +524,7 @@ class DmsfFile < ActiveRecord::Base RedmineDmsf::Preview.generate last_revision&.disk_file.to_s, target rescue => e Rails.logger.error "An error occurred while generating preview for #{last_revision&.disk_file} to #{target}\nException was: #{e.message}" - '' + nil end end diff --git a/app/views/dmsf/_main.html.erb b/app/views/dmsf/_main.html.erb index 2f32e0c0..923748ca 100644 --- a/app/views/dmsf/_main.html.erb +++ b/app/views/dmsf/_main.html.erb @@ -130,7 +130,3 @@ }); <% end %> <% end %> - -<% late_javascript_tag do %> - "$('#ajax-indicator').hide();" -<% end %> diff --git a/app/views/dmsf_upload/upload_files.html.erb b/app/views/dmsf_upload/upload_files.html.erb index d0a7dfc4..7af56843 100644 --- a/app/views/dmsf_upload/upload_files.html.erb +++ b/app/views/dmsf_upload/upload_files.html.erb @@ -45,8 +45,7 @@ <% end %> <% end %>
- <%= submit_tag l(:label_upload), class: 'button-positive', - onclick: "$('#ajax-indicator').show();" %> + <%= submit_tag l(:label_upload), class: 'button-positive' %>
<% end %> <% end %> diff --git a/progress.patch b/progress.patch deleted file mode 100644 index a985f6c0..00000000 --- a/progress.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/app/controllers/dmsf_upload_controller.rb b/app/controllers/dmsf_upload_controller.rb -index b2590f2..2515b47 100644 ---- a/app/controllers/dmsf_upload_controller.rb -+++ b/app/controllers/dmsf_upload_controller.rb -@@ -132,6 +132,7 @@ class DmsfUploadController < ApplicationController - - def commit_files_internal(commited_files) - @files, failed_uploads = DmsfUploadHelper.commit_files_internal(commited_files, @project, @folder, self) -+ call_hook(:dmsf_upload_controller_after_commit, { files: @files }) - respond_to do |format| - format.js - format.api { render_validation_errors(failed_uploads) unless failed_uploads.empty? } -diff --git a/app/views/dmsf/_main.html.erb b/app/views/dmsf/_main.html.erb -index 923748c..2f32e0c 100644 ---- a/app/views/dmsf/_main.html.erb -+++ b/app/views/dmsf/_main.html.erb -@@ -130,3 +130,7 @@ - }); - <% end %> - <% end %> -+ -+<% late_javascript_tag do %> -+ "$('#ajax-indicator').hide();" -+<% end %> -diff --git a/app/views/dmsf_upload/upload_files.html.erb b/app/views/dmsf_upload/upload_files.html.erb -index 7af5684..d0a7dfc 100644 ---- a/app/views/dmsf_upload/upload_files.html.erb -+++ b/app/views/dmsf_upload/upload_files.html.erb -@@ -45,7 +45,8 @@ - <% end %> - <% end %> -
-- <%= submit_tag l(:label_upload), class: 'button-positive' %> -+ <%= submit_tag l(:label_upload), class: 'button-positive', -+ onclick: "$('#ajax-indicator').show();" %> -
- <% end %> - <% end %>