commit 3c4e315c9f3e7b3cd4da6a58c1e161570871bfa3 Author: licsber Date: Sat Aug 23 10:58:15 2025 +0800 init commit. diff --git a/README.md b/README.md new file mode 100644 index 0000000..33531ed --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# open_explorer + +Redmine插件,一键打开归档地址。 + +## Install + +``` +cd plugins +git clone https://git.licsber.site/ruby/open_explorer +``` diff --git a/app/views/hooks/_view_issues_show_description_bottom.html.erb b/app/views/hooks/_view_issues_show_description_bottom.html.erb new file mode 100644 index 0000000..e6b25ae --- /dev/null +++ b/app/views/hooks/_view_issues_show_description_bottom.html.erb @@ -0,0 +1,8 @@ +<% 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 new file mode 100644 index 0000000..3c7afbe --- /dev/null +++ b/init.rb @@ -0,0 +1,8 @@ +Redmine::Plugin.register :open_explorer do + name 'Open Explorer plugin' + author 'licsber' + description 'Open archive path using explorer.' + version '0.0.1' + url 'https://git.licsber.site/ruby/open_explorer' + author_url 'https://licsber.site' +end diff --git a/lib/hooks.rb b/lib/hooks.rb new file mode 100644 index 0000000..074d556 --- /dev/null +++ b/lib/hooks.rb @@ -0,0 +1,4 @@ +class Hooks < Redmine::Hook::ViewListener + render_on :view_issues_show_description_bottom, + :partial => 'hooks/view_issues_show_description_bottom' +end