#1448, add copy to clipboard option
This commit is contained in:
parent
584ce8c31c
commit
93d67a8307
|
@ -13,4 +13,9 @@ module SocialHelper
|
|||
protocol: (APP_CONFIG["https"] ? :https : :http),
|
||||
)
|
||||
end
|
||||
|
||||
def answer_copy_content(answer)
|
||||
# copy content template: "question - answer [link]"
|
||||
"#{answer.question.content} - #{answer.content} [#{answer_share_url(answer)}]"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,5 +8,8 @@
|
|||
%a.dropdown-item{ href: telegram_share_url(answer), target: "_blank" }
|
||||
%i.fa.fa-fw.fa-telegram
|
||||
= t(".telegram")
|
||||
%a.dropdown-item{ href: "#", data: { controller: :share, action: "share#copyToClipboard", share_copy_content_value: answer_copy_content(answer) } }
|
||||
%i.fa.fa-fw.fa-solid.fa-copy
|
||||
= t(".copy")
|
||||
%a.dropdown-item{ href: "#", data: { controller: :share, action: "share#share", share_url_value: answer_share_url(answer) } }
|
||||
= t(".other")
|
||||
|
|
|
@ -79,6 +79,7 @@ en:
|
|||
pin: "Pin to Profile"
|
||||
unpin: "Unpin from Profile"
|
||||
share:
|
||||
copy: "Copy to Clipboard"
|
||||
twitter: "Share on Twitter"
|
||||
tumblr: "Share on Tumblr"
|
||||
telegram: "Share on Telegram"
|
||||
|
|
Loading…
Reference in New Issue