summaryrefslogtreecommitdiffstats
path: root/app/helpers
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/helpers
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/helpers')
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/helpers/journals_helper.rb4
2 files changed, 11 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,