summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-18 03:58:29 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-18 03:58:29 +0000
commit44ea826a21071ab3e0b07ecfcd56020eea219078 (patch)
tree6006b28121b01d573d3545c23010bea66e8c189e /app
parent06ac3473e0eb9d233611320ca2ed6d2c3e4f6547 (diff)
downloadredmine-44ea826a21071ab3e0b07ecfcd56020eea219078.tar.gz
redmine-44ea826a21071ab3e0b07ecfcd56020eea219078.zip
"Copy link" feature for issue and issue journal (#34703).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@20816 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/helpers/journals_helper.rb4
-rw-r--r--app/views/issues/_action_menu.html.erb1
3 files changed, 12 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5163ea181..fe95eea47 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1818,6 +1818,14 @@ module ApplicationHelper
)
end
+ def copy_object_url_link(url)
+ link_to_function(
+ l(:button_copy_link), 'copyTextToClipboard(this);',
+ class: 'icon icon-copy-link',
+ data: {'clipboard-text' => url}
+ )
+ end
+
private
def wiki_helper
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb
index 4c3d410ec..ef649a278 100644
--- a/app/helpers/journals_helper.rb
+++ b/app/helpers/journals_helper.rb
@@ -29,9 +29,11 @@ module JournalsHelper
def render_journal_actions(issue, journal, options={})
links = []
dropbown_links = []
+ indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
+
+ dropbown_links << copy_object_url_link(issue_url(issue, anchor: "note-#{indice}", only_path: false))
if journal.notes.present?
if options[:reply_links]
- indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
links << link_to(l(:button_quote),
quoted_issue_path(issue, :journal_id => journal, :journal_indice => indice),
:remote => true,
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb
index 93e5bad63..a1dcd6312 100644
--- a/app/views/issues/_action_menu.html.erb
+++ b/app/views/issues/_action_menu.html.erb
@@ -6,6 +6,7 @@
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
<%= watcher_link(@issue, User.current) %>
<%= actions_dropdown do %>
+ <%= copy_object_url_link(issue_url(@issue, only_path: false)) %>
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue),
:class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
<%= link_to l(:button_delete), issue_path(@issue),