diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-04-12 10:12:42 -0400 |
---|---|---|
committer | Eugen <eugen@zeonfederated.com> | 2017-04-12 16:12:42 +0200 |
commit | dd1ae3b10924ca239daa17ce2fe739f790e6f96d (patch) | |
tree | 28f3b8ee56bde264236fb3e01c059f1dc7bfa0a5 /app/helpers | |
parent | b352a8e5d4f3dba4b923a2a21dc9ae5343e7e8e4 (diff) |
Simplify the way the embed view is created (#1590)
* Add coverage for embedded status view * Refactor embed view to eliminate @external_links variable
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/stream_entries_helper.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index d5cc004b0..59aac7841 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -5,8 +5,12 @@ module StreamEntriesHelper account.display_name.blank? ? account.username : account.display_name end + def stream_link_target + embedded_view? ? '_blank' : nil + end + def acct(account) - "@#{account.acct}#{@external_links && account.local? ? "@#{Rails.configuration.x.local_domain}" : ''}" + "@#{account.acct}#{embedded_view? && account.local? ? "@#{Rails.configuration.x.local_domain}" : ''}" end def entry_classes(status, is_predecessor, is_successor, include_threads) @@ -30,4 +34,10 @@ module StreamEntriesHelper rtl_size / ltr_size > 0.3 end + + private + + def embedded_view? + params[:controller] == 'stream_entries' && params[:action] == 'embed' + end end |