about summary refs log tree commit diff
path: root/app/views/stream_entries
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-12 12:24:18 -0400
committerEugen <eugen@zeonfederated.com>2017-04-12 18:24:18 +0200
commitc44a7002525d6f87dde923971ac7a95a48e9bc4f (patch)
treea47e5c7dbd8555fd216f60f933e1e4f181e0a5a1 /app/views/stream_entries
parentaa9079838648e9656a1bf8d10151713686e1c0dd (diff)
Quick best practice cleanup of views/helpers (#1546)
* Remove trailing whitespace

* Use query methods instead of explicit .blank? checks
Diffstat (limited to 'app/views/stream_entries')
-rw-r--r--app/views/stream_entries/_detailed_status.html.haml4
-rw-r--r--app/views/stream_entries/_simple_status.html.haml4
2 files changed, 4 insertions, 4 deletions
diff --git a/app/views/stream_entries/_detailed_status.html.haml b/app/views/stream_entries/_detailed_status.html.haml
index 5fc6ab42f..c42e6614a 100644
--- a/app/views/stream_entries/_detailed_status.html.haml
+++ b/app/views/stream_entries/_detailed_status.html.haml
@@ -8,11 +8,11 @@
       %span.p-nickname= acct(status.account)
 
   .status__content.e-content.p-name.emojify<
-    - unless status.spoiler_text.blank?
+    - if status.spoiler_text?
       %p{ style: 'margin-bottom: 0' }<
         %span>= "#{status.spoiler_text} "
         %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
-    %div{ style: "display: #{status.spoiler_text.blank? ? 'block' : 'none'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
+    %div{ style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
 
   - unless status.media_attachments.empty?
     - if status.media_attachments.first.video?
diff --git a/app/views/stream_entries/_simple_status.html.haml b/app/views/stream_entries/_simple_status.html.haml
index 5b6069e33..a758d5ccd 100644
--- a/app/views/stream_entries/_simple_status.html.haml
+++ b/app/views/stream_entries/_simple_status.html.haml
@@ -13,11 +13,11 @@
         %span.p-nickname= acct(status.account)
 
   .status__content.e-content.p-name.emojify<
-    - unless status.spoiler_text.blank?
+    - if status.spoiler_text?
       %p{ style: 'margin-bottom: 0' }<
         %span>= "#{status.spoiler_text} "
         %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
-    %div{ style: "display: #{status.spoiler_text.blank? ? 'block' : 'none'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
+    %div{ style: "display: #{status.spoiler_text? ? 'none' : 'block'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
 
   - unless status.media_attachments.empty?
     .status__attachments