0
0
Fork 0

Simplify the way the embed view is created (#1590)

* Add coverage for embedded status view

* Refactor embed view to eliminate @external_links variable
This commit is contained in:
Matt Jankowski 2017-04-12 10:12:42 -04:00 committed by Eugen
parent b352a8e5d4
commit dd1ae3b109
5 changed files with 25 additions and 7 deletions

View file

@ -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