diff --git a/app/views/my/_sidebar.html.erb b/app/views/hooks/redmine_dmsf/_view_mailer_issue.html.erb
similarity index 53%
rename from app/views/my/_sidebar.html.erb
rename to app/views/hooks/redmine_dmsf/_view_mailer_issue.html.erb
index b9fe2eb9..79c12d74 100644
--- a/app/views/my/_sidebar.html.erb
+++ b/app/views/hooks/redmine_dmsf/_view_mailer_issue.html.erb
@@ -1,9 +1,7 @@
<%
- # encoding: utf-8
- #
# Redmine plugin for Document Management System "Features"
#
- # Karel Pičman
+ # Vít Jonáš , Daniel Munn , Karel Pičman
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -20,21 +18,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
-<%# Render the original view %>
-<% view_paths.unshift Rails.root.join('app/views').to_s %>
-<%= render partial: 'my/sidebar' %>
-
-<%# DMSF extension do %>
-<% if Setting.plugin_redmine_dmsf['dmsf_webdav_authentication'] == 'Digest' %>
-
+
<% end %>
-<%# end %>
diff --git a/app/views/hooks/redmine_dmsf/_view_mailer_issue.text.erb b/app/views/hooks/redmine_dmsf/_view_mailer_issue.text.erb
new file mode 100644
index 00000000..dd93622e
--- /dev/null
+++ b/app/views/hooks/redmine_dmsf/_view_mailer_issue.text.erb
@@ -0,0 +1,26 @@
+<%
+ # Redmine plugin for Document Management System "Features"
+ #
+ # Vít Jonáš , Daniel Munn , Karel Pičman
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU General Public License
+ # as published by the Free Software Foundation; either version 2
+ # of the License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+%>
+
+<% if issue.dmsf_files.any? %>
+ ---<%= l(:label_dmsf_file_plural).ljust(37, '-') %>
+ <% issue.dmsf_files.each do |f| %>
+ <%= f.name %> (<%= number_to_human_size(f.last_revision.size) %>)
+ <% end %>
+<% end %>
diff --git a/app/views/hooks/redmine_dmsf/_view_my_account.html.erb b/app/views/hooks/redmine_dmsf/_view_my_account.html.erb
index 5765d0b2..642c8e3e 100644
--- a/app/views/hooks/redmine_dmsf/_view_my_account.html.erb
+++ b/app/views/hooks/redmine_dmsf/_view_my_account.html.erb
@@ -28,3 +28,15 @@
+<% end %>
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb
index 04124883..d918a6ac 100644
--- a/app/views/mailer/_issue.html.erb
+++ b/app/views/mailer/_issue.html.erb
@@ -25,13 +25,5 @@
<%= render partial: 'mailer/issue', locals: { issue: issue, issue_url: issue_url, user: user } %>
<%# DMSF extension do %>
-<% if issue.dmsf_files.any? %>
-
-
-<% end %>
+ <%= render partial: 'hooks/redmine_dmsf/view_mailer_issue', locals: { issue: issue } %>
<%# end %>
diff --git a/app/views/mailer/_issue.text.erb b/app/views/mailer/_issue.text.erb
index d5e7c64d..d918a6ac 100644
--- a/app/views/mailer/_issue.text.erb
+++ b/app/views/mailer/_issue.text.erb
@@ -25,10 +25,5 @@
<%= render partial: 'mailer/issue', locals: { issue: issue, issue_url: issue_url, user: user } %>
<%# DMSF extension do %>
-<% if issue.dmsf_files.any? %>
----<%= l(:label_dmsf_file_plural).ljust(37, '-') %>
-<% issue.dmsf_files.each do |f| %>
-<%= f.name %> (<%= number_to_human_size(f.last_revision.size) %>)
-<% end %>
-<% end %>
+ <%= render partial: 'hooks/redmine_dmsf/view_mailer_issue', locals: { issue: issue } %>
<%# end %>
diff --git a/lib/redmine_dmsf.rb b/lib/redmine_dmsf.rb
index ea387f13..417eeaab 100644
--- a/lib/redmine_dmsf.rb
+++ b/lib/redmine_dmsf.rb
@@ -77,6 +77,7 @@ def require_hooks
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/base_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/custom_field_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/issue_view_hooks"
+ require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/mailer_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/my_account_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/search_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/issues_helper_hooks"
diff --git a/lib/redmine_dmsf/hooks/views/mailer_view_hooks.rb b/lib/redmine_dmsf/hooks/views/mailer_view_hooks.rb
new file mode 100644
index 00000000..8e5bb142
--- /dev/null
+++ b/lib/redmine_dmsf/hooks/views/mailer_view_hooks.rb
@@ -0,0 +1,41 @@
+# frozen_string_literal: true
+
+# Redmine plugin for Document Management System "Features"
+#
+# Karel Pičman
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# User form view hooks
+
+module RedmineDmsf
+ module Hooks
+ module Views
+ # Mailer view hooks
+ class MailerViewHooks < Redmine::Hook::ViewListener
+ def view_mailer_issue_show_text_bottom(context = {})
+ context[:controller].send :render_to_string,
+ { partial: 'hooks/redmine_dmsf/view_mailer_issue',
+ locals: { issue: context[:issue] } }
+ end
+
+ def view_mailer_issue_show_html_bottom(context = {})
+ context[:controller].send :render_to_string,
+ { partial: 'hooks/redmine_dmsf/view_mailer_issue',
+ locals: { issue: context[:issue] } }
+ end
+ end
+ end
+ end
+end
diff --git a/lib/redmine_dmsf/hooks/views/my_account_view_hooks.rb b/lib/redmine_dmsf/hooks/views/my_account_view_hooks.rb
index 20146f27..d9bd322e 100644
--- a/lib/redmine_dmsf/hooks/views/my_account_view_hooks.rb
+++ b/lib/redmine_dmsf/hooks/views/my_account_view_hooks.rb
@@ -25,10 +25,7 @@ module RedmineDmsf
# My account view hooks
class MyAccountViewHooks < Redmine::Hook::ViewListener
def view_my_account_preferences(context = {})
- return unless context.is_a?(Hash) && context[:user]
-
- context[:controller].send :render_to_string,
- { partial: 'hooks/redmine_dmsf/view_my_account', locals: context }
+ context[:controller].send :render_to_string, { partial: 'hooks/redmine_dmsf/view_my_account' }
end
end
end