docbrown/app/views/shared/_display_ad.html.erb
Ridhwana 0771a5cd2e
Load post_comments billboard asynchronously (#19285)
* feat: add a route to the async_info for display ads

* feat: load the billboard asyncronously

* feat: move the methods to the display_ads controller

* feat: handle params better

* feat: cache control headers

* feat: test fastly caching headers on display ads

* fix: surrogate key test

* feat: use safe navigation operator to handle cases where there is no article id

* fix: article id present then find the article

* feat: add a response test

* Fragment caching

* feat: update the article decorator

* feat: update cache keys for fragment

* feat: remove an empty line

* feat: add article id

* feat: bust cache

* feat: setup dropdown for billboard

* chore: add chunk to same line

* feat: add to safe params for caching

* Update app/controllers/display_ads_controller.rb

Co-authored-by: Joshua Wehner <joshua@forem.com>

* feat: remove the cache deletion

* feat: update the routes to follow a new scope

* feat: update the cache params

---------

Co-authored-by: Joshua Wehner <joshua@forem.com>
2023-04-12 18:15:15 +02:00

31 lines
1.4 KiB
Text

<% if display_ad.placement_area.start_with?("feed_") %>
<div class="crayons-story crayons-story__display-ad"
data-display-unit data-id="<%= display_ad.id %>"
data-category-click="<%= DisplayAdEvent::CATEGORY_CLICK %>"
data-category-impression="<%= DisplayAdEvent::CATEGORY_IMPRESSION %>"
data-context-type="<%= data_context_type %>"
data-type-of="<%= display_ad.type_of %>">
<div class="crayons-story__body">
<div class="crayons-story__top">
<%= render partial: "shared/display_ad_header", locals: { display_ad: display_ad } %>
</div>
<div class="crayons-story__indention-display-ad">
<div class="text-styles text-styles--display-ad">
<%= display_ad.processed_html.html_safe %>
</div>
</div>
</div>
</div>
<% else %>
<div class="crayons-card crayons-card--secondary crayons-sponsorship"
data-display-unit data-id="<%= display_ad.id %>"
data-category-click="<%= DisplayAdEvent::CATEGORY_CLICK %>"
data-category-impression="<%= DisplayAdEvent::CATEGORY_IMPRESSION %>"
data-context-type="<%= data_context_type %>"
data-type-of="<%= display_ad.type_of %>">
<%= render partial: "shared/display_ad_header", locals: { display_ad: display_ad } %>
<div class="p-1 pt-3 text-styles text-styles--display-ad">
<%= display_ad.processed_html.html_safe %>
</div>
</div>
<% end %>