about summary refs log tree commit diff
path: root/app/views/stream_entries/_status.html.haml
diff options
context:
space:
mode:
authorRenato "Lond" Cerqueira <renato@lond.com.br>2018-08-30 23:14:01 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-08-30 23:14:01 +0200
commit11658d8653c7caadddfb0e3fe27272107c2e87b1 (patch)
tree03c402b01b09f7a0851e3e1a1dae05c889b5605f /app/views/stream_entries/_status.html.haml
parent5b2b493a908cbea55096f7f028c306f6270e3b00 (diff)
Add animate custom emoji param to embed pages (#8507)
* Add animate custom emoji param to embed pages

* Rename param, use it for avatars and gifs

* Fix issues pointed by codeclimate and breaking test

* Ignore brakeman warning
Diffstat (limited to 'app/views/stream_entries/_status.html.haml')
-rw-r--r--app/views/stream_entries/_status.html.haml7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/stream_entries/_status.html.haml b/app/views/stream_entries/_status.html.haml
index 92003a48f..83887cd87 100644
--- a/app/views/stream_entries/_status.html.haml
+++ b/app/views/stream_entries/_status.html.haml
@@ -5,6 +5,7 @@
   is_successor    ||= false
   direct_reply_id ||= false
   parent_id       ||= false
+  autoplay        ||= current_account&.user&.setting_auto_play_gif
   is_direct_parent  = direct_reply_id == status.id
   is_direct_child   = parent_id == status.in_reply_to_id
   centered        ||= include_threads && !is_predecessor && !is_successor
@@ -18,7 +19,7 @@
     .entry{ class: entry_classes }
       = link_to_more TagManager.instance.url_for(@next_ancestor)
 
-  = render partial: 'stream_entries/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }
+  = render partial: 'stream_entries/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }, autoplay: autoplay
 
 .entry{ class: entry_classes }
 
@@ -38,14 +39,14 @@
       %span
         = t('stream_entries.pinned')
 
-  = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
+  = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper, autoplay: autoplay
 
 - if include_threads
   - if @since_descendant_thread_id
     .entry{ class: entry_classes }
       = link_to_more short_account_status_url(status.account.username, status, max_descendant_thread_id: @since_descendant_thread_id + 1)
   - @descendant_threads.each do |thread|
-    = render partial: 'stream_entries/status', collection: thread[:statuses], as: :status, locals: { is_successor: true, parent_id: status.id }
+    = render partial: 'stream_entries/status', collection: thread[:statuses], as: :status, locals: { is_successor: true, parent_id: status.id }, autoplay: autoplay
 
     - if thread[:next_status]
       .entry{ class: entry_classes }