From 3c4e315c9f3e7b3cd4da6a58c1e161570871bfa3 Mon Sep 17 00:00:00 2001 From: licsber Date: Sat, 23 Aug 2025 10:58:15 +0800 Subject: [PATCH] init commit. --- README.md | 10 ++++++++++ .../_view_issues_show_description_bottom.html.erb | 8 ++++++++ init.rb | 8 ++++++++ lib/hooks.rb | 4 ++++ 4 files changed, 30 insertions(+) create mode 100644 README.md create mode 100644 app/views/hooks/_view_issues_show_description_bottom.html.erb create mode 100644 init.rb create mode 100644 lib/hooks.rb 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