Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add video to additional home feed context (#1815)
  • Loading branch information
benhalpern committed Feb 17, 2019
1 parent c1eecd1 commit 20d1c8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/articles/_single_story.html.erb
@@ -1,6 +1,6 @@
<div class="single-article single-article-small-pic">
<% if story.video.present? && story.video_thumbnail_url.present? %>
<a class="single-article-video-preview" style="background-image:url(<%= story.cloudinary_video_url %>)" >
<a class="single-article-video-preview" style="background-image:url(<%= story.cloudinary_video_url %>)" href="<%= story.path %>" >
<div class="single-article-video-duration"><img src="<%= asset_path("video-camera.svg") %>" /><%= story.video_duration_in_minutes %></div>
</a>
<% end %>
Expand Down
10 changes: 6 additions & 4 deletions app/views/stories/_main_stories_feed.html.erb
Expand Up @@ -9,17 +9,19 @@
decorate %>
<div id="new-articles-object" data-articles="
<%= @new_stories.to_json(only:
[:title, :path, :id, :user_id, :comments_count, :positive_reactions_count, :organization_id, :reading_time],
[:title, :path, :id, :user_id, :comments_count, :positive_reactions_count, :organization_id,
:reading_time, :video_thumbnail_url, :video],
methods:
[:readable_publish_date, :cached_tag_list_array, :flare_tag, :class_name],
[:readable_publish_date, :cached_tag_list_array, :flare_tag, :class_name, :cloudinary_video_url, :video_duration_in_minutes],
include: {user: {only: [:username, :name], methods: [:profile_image_90]},
organization: {only: [:slug, :name], methods: [:profile_image_90]}}) %>">
</div>
<div id="home-articles-object" data-articles="
<%= @stories.to_json(only:
[:title, :path, :id, :user_id, :comments_count, :positive_reactions_count, :organization_id, :reading_time],
[:title, :path, :id, :user_id, :comments_count, :positive_reactions_count, :organization_id,
:reading_time, :video_thumbnail_url, :video, :video_duration_in_minutes],
methods:
[:readable_publish_date, :cached_tag_list_array, :flare_tag, :class_name],
[:readable_publish_date, :cached_tag_list_array, :flare_tag, :class_name, :cloudinary_video_url, :video_duration_in_minutes],
include: { user: {only: [:username, :name], methods: [:profile_image_90]},
organization: {only: [:slug, :name], methods: [:profile_image_90]}}) %>">
<% 3.times do %>
Expand Down

0 comments on commit 20d1c8b

Please sign in to comment.