File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ def index
5555 @questioned_content = @content . sample
5656 @attribute_field_to_question = SerendipitousService . question_for ( @questioned_content )
5757
58+ @random_image_including_private_pool_cache = ImageUpload . where (
59+ content_type : @content_type_class . name ,
60+ content_id : @content . pluck ( :id )
61+ ) . group_by { |image | [ image . content_type , image . content_id ] }
62+
5863 # Uh, do we ever actually make JSON requests to logged-in user pages?
5964 respond_to do |format |
6065 format . html { render 'content/index' }
Original file line number Diff line number Diff line change 11< div class ="js-content-cards-list ">
22 <% content_list . each . with_index do |content , i | %>
3+ <%
4+ content_image = @random_image_including_private_pool_cache [ [ content . page_type , content . id ] ]
5+ . sample
6+ . try ( :src , :medium ) || asset_path ( "card-headers/#{ content . page_type . downcase . pluralize } .jpg" )
7+ %>
38 < div class ="col s12 m6 l4 js-content-card-container ">
49 < div class ="hoverable card sticky-action " style ="margin-bottom: 2px ">
510 < div class ="card-image waves-effect waves-block waves-light ">
611 <%= render partial : 'content/display/favorite_control' , locals : { content : content } %>
7- < div class ="activator " style ="height: 265px; background: url('<%= content . random_image_including_private ( format : :medium ) %> '); background-size: cover; "> </ div >
12+ < div class ="activator " style ="height: 265px; background: url('<%= content_image %> '); background-size: cover; "> </ div >
813
914 < span class ="card-title js-content-name activator ">
1015 < div class ="bordered-text ">
You can’t perform that action at this time.
0 commit comments