Add Stimulus sharing feature to answerboxes
This commit is contained in:
parent
5ccdd9bbc2
commit
9f999189cd
|
@ -4,4 +4,13 @@ module SocialHelper
|
||||||
include SocialHelper::TwitterMethods
|
include SocialHelper::TwitterMethods
|
||||||
include SocialHelper::TumblrMethods
|
include SocialHelper::TumblrMethods
|
||||||
include SocialHelper::TelegramMethods
|
include SocialHelper::TelegramMethods
|
||||||
|
|
||||||
|
def answer_share_url(answer)
|
||||||
|
answer_url(
|
||||||
|
id: answer.id,
|
||||||
|
username: answer.user.screen_name,
|
||||||
|
host: APP_CONFIG["hostname"],
|
||||||
|
protocol: (APP_CONFIG["https"] ? :https : :http)
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
%a.dropdown-item{ href: telegram_share_url(answer), target: "_blank" }
|
%a.dropdown-item{ href: telegram_share_url(answer), target: "_blank" }
|
||||||
%i.fa.fa-fw.fa-telegram
|
%i.fa.fa-fw.fa-telegram
|
||||||
= t(".telegram")
|
= t(".telegram")
|
||||||
%a.dropdown-item{ href: "#", name: "ab-share" }
|
%a.dropdown-item{ href: "#", data: { controller: :share, action: "share#share", share_url_value: answer_share_url(answer) } }
|
||||||
= t(".other")
|
= t(".other")
|
||||||
|
|
Loading…
Reference in New Issue