diff --git a/README.md b/README.md index 33531ed..b90dde1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,13 @@ Redmine插件,一键打开归档地址。 ## Install -``` +```bash cd plugins git clone https://git.licsber.site/ruby/open_explorer ``` + +## ChangeLog + +``` +250823周六:(0.0.2)位置改为上下文菜单之下 +``` diff --git a/app/views/hooks/_view_issues_context_menu_end.html.erb b/app/views/hooks/_view_issues_context_menu_end.html.erb new file mode 100644 index 0000000..f17ef80 --- /dev/null +++ b/app/views/hooks/_view_issues_context_menu_end.html.erb @@ -0,0 +1,35 @@ +<% issue = @issue %> + +<% + archive_custom_field = issue.custom_field_values.find do |cfv| + cfv.custom_field.name == "归档地址" + end +%> + +<% if archive_custom_field && archive_custom_field.value.present? %> + <% archive_url = archive_custom_field.value.strip %> + + 📂 一键打开归档地址 + +<% end %> + + diff --git a/app/views/hooks/_view_issues_show_description_bottom.html.erb b/app/views/hooks/_view_issues_show_description_bottom.html.erb deleted file mode 100644 index e6b25ae..0000000 --- a/app/views/hooks/_view_issues_show_description_bottom.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% issue = @issue %> - -<% archive_custom_field = issue.custom_field_values.find { |cfv| cfv.custom_field.name == "归档地址" } %> - -<% if archive_custom_field && archive_custom_field.value.present? %> - <% archive_url = archive_custom_field.value.strip %> - 📂 一键打开归档地址 -<% end %> diff --git a/init.rb b/init.rb index 3c7afbe..c98443c 100644 --- a/init.rb +++ b/init.rb @@ -2,7 +2,7 @@ Redmine::Plugin.register :open_explorer do name 'Open Explorer plugin' author 'licsber' description 'Open archive path using explorer.' - version '0.0.1' + version '0.0.2' url 'https://git.licsber.site/ruby/open_explorer' author_url 'https://licsber.site' end diff --git a/lib/hooks.rb b/lib/hooks.rb index 074d556..6c3c874 100644 --- a/lib/hooks.rb +++ b/lib/hooks.rb @@ -1,4 +1,4 @@ class Hooks < Redmine::Hook::ViewListener - render_on :view_issues_show_description_bottom, - :partial => 'hooks/view_issues_show_description_bottom' + render_on :view_issues_context_menu_end, + :partial => 'hooks/view_issues_context_menu_end' end