Add additional content back in (#5030) [deploy]
This commit is contained in:
parent
538f3cd29d
commit
19990b0ce0
3 changed files with 90 additions and 96 deletions
|
|
@ -42,10 +42,8 @@ module CacheBuster
|
|||
bust("#{article.path}?preview=#{article.password}")
|
||||
bust("#{article.path}?preview=#{article.password}&i=i")
|
||||
bust("/#{article.organization.slug}") if article.organization.present?
|
||||
unless Rails.env.production?
|
||||
bust_home_pages(article)
|
||||
bust_tag_pages(article)
|
||||
end
|
||||
bust_home_pages(article)
|
||||
bust_tag_pages(article)
|
||||
bust("/api/articles/#{article.id}")
|
||||
return unless article.collection_id
|
||||
|
||||
|
|
|
|||
|
|
@ -73,64 +73,62 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% unless Rails.env.production? %>
|
||||
<% if @variant_number.to_i == 1 %>
|
||||
<% cache("html-variant-sidebar#{rand(300)}", expires_in: 2.hours) do %>
|
||||
<% @html_variant = HtmlVariant.find_for_test(@article.cached_tag_list_array) %>
|
||||
<% if @html_variant %>
|
||||
<div class="html-variant-wrapper" id="html-variant-article-show-sidebar" data-variant-id="<%= @html_variant.id %>">
|
||||
<%= @html_variant.html.html_safe %>
|
||||
<% if @variant_number.to_i == 1 %>
|
||||
<% cache("html-variant-sidebar#{rand(300)}", expires_in: 2.hours) do %>
|
||||
<% @html_variant = HtmlVariant.find_for_test(@article.cached_tag_list_array) %>
|
||||
<% if @html_variant %>
|
||||
<div class="html-variant-wrapper" id="html-variant-article-show-sidebar" data-variant-id="<%= @html_variant.id %>">
|
||||
<%= @html_variant.html.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% cache("article-sticky-nav-articles-#{@article.id}-#{@actor.last_article_at}", expires_in: 48.hours) do %>
|
||||
<% @sticky_collection = StickyArticleCollection.new(@article, @organization || @user) %>
|
||||
<% @sticky_articles = @sticky_collection.suggested_stickies %>
|
||||
<% @user_stickies = @sticky_collection.user_stickies %>
|
||||
<% if @user_stickies.any? %>
|
||||
<% @user_stickies.each_with_index do |article, index| %>
|
||||
<div class="primary-sticky-nav-element-wrapper">
|
||||
<% if index == 0 %>
|
||||
<div class="primary-sticky-nav-title">
|
||||
<% if @actor.username.size < 18 %>
|
||||
More from <a href="<%= @actor.path %>">@<%= @actor.username %></a>
|
||||
<% else %>
|
||||
More from<br /><a href="<%= @actor.path %>">@<%= @actor.username %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<a class="primary-sticky-nav-element primary-sticky-nav-author-element" href="<%= article.path %>">
|
||||
<img src="<%= ProfileImage.new(article.user).get(90) %>" class="primary-sticky-nav-profile-image" loading="lazy" alt="<%= article.user.name %> profile image">
|
||||
<%= article.title %>
|
||||
<div class="primary-sticky-nav-element-details">
|
||||
<% article.decorate.cached_tag_list_array.each do |tag| %>
|
||||
<span>#<%= tag %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% cache("article-sticky-nav-articles-#{@article.id}-#{@actor.last_article_at}", expires_in: 48.hours) do %>
|
||||
<% @sticky_collection = StickyArticleCollection.new(@article, @organization || @user) %>
|
||||
<% @sticky_articles = @sticky_collection.suggested_stickies %>
|
||||
<% @user_stickies = @sticky_collection.user_stickies %>
|
||||
<% if @user_stickies.any? %>
|
||||
<% @user_stickies.each_with_index do |article, index| %>
|
||||
<div class="primary-sticky-nav-element-wrapper">
|
||||
<% if index == 0 %>
|
||||
<div class="primary-sticky-nav-title">
|
||||
<% if @actor.username.size < 18 %>
|
||||
More from <a href="<%= @actor.path %>">@<%= @actor.username %></a>
|
||||
<% else %>
|
||||
More from<br /><a href="<%= @actor.path %>">@<%= @actor.username %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<a class="primary-sticky-nav-element primary-sticky-nav-author-element" href="<%= article.path %>">
|
||||
<img src="<%= ProfileImage.new(article.user).get(90) %>" class="primary-sticky-nav-profile-image" loading="lazy" alt="<%= article.user.name %> profile image">
|
||||
<%= article.title %>
|
||||
<div class="primary-sticky-nav-element-details">
|
||||
<% article.decorate.cached_tag_list_array.each do |tag| %>
|
||||
<span>#<%= tag %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @sticky_articles %>
|
||||
<% @sticky_articles.each_with_index do |article, index| %>
|
||||
<div class="primary-sticky-nav-element-wrapper">
|
||||
<% if index == 0 %>
|
||||
<div class="primary-sticky-nav-title">
|
||||
<img src="<%= asset_path "emoji/apple-fire.png" %>" alt="Fire emoji" loading="lazy"> Trending on <a href="<%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>"><%= ApplicationConfig["COMMUNITY_NAME"] %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<a class="primary-sticky-nav-element" href="<%= article.path %>">
|
||||
<img src="<%= ProfileImage.new(article.user).get(90) %>" class="primary-sticky-nav-profile-image" loading="lazy" alt="<%= article.user.name %> profile image">
|
||||
<%= article.title %>
|
||||
<div class="primary-sticky-nav-element-details">
|
||||
<% article.decorate.cached_tag_list_array.each do |tag| %>
|
||||
<span>#<%= tag %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @sticky_articles %>
|
||||
<% @sticky_articles.each_with_index do |article, index| %>
|
||||
<div class="primary-sticky-nav-element-wrapper">
|
||||
<% if index == 0 %>
|
||||
<div class="primary-sticky-nav-title">
|
||||
<img src="<%= asset_path "emoji/apple-fire.png" %>" alt="Fire emoji" loading="lazy"> Trending on <a href="<%= ApplicationConfig["APP_PROTOCOL"] %><%= ApplicationConfig["APP_DOMAIN"] %>"><%= ApplicationConfig["COMMUNITY_NAME"] %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<a class="primary-sticky-nav-element" href="<%= article.path %>">
|
||||
<img src="<%= ProfileImage.new(article.user).get(90) %>" class="primary-sticky-nav-profile-image" loading="lazy" alt="<%= article.user.name %> profile image">
|
||||
<%= article.title %>
|
||||
<div class="primary-sticky-nav-element-details">
|
||||
<% article.decorate.cached_tag_list_array.each do |tag| %>
|
||||
<span>#<%= tag %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,44 +1,42 @@
|
|||
<% unless Rails.env.production? %>
|
||||
<div id="sidebar-wrapper-right" class="sidebar-wrapper sidebar-wrapper-right">
|
||||
<div class="sidebar-bg" id="sidebar-bg-right"></div>
|
||||
<div class="side-bar sidebar-additional showing" id="sidebar-additional">
|
||||
<% if Article.active_threads([@tag, "discuss"], Timeframer.new(params[:timeframe]).datetime).any? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>#discuss</h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<div class="widget-link-list">
|
||||
<% Article.active_threads([@tag, "discuss"], Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
||||
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="sidebar-wrapper-right" class="sidebar-wrapper sidebar-wrapper-right">
|
||||
<div class="sidebar-bg" id="sidebar-bg-right"></div>
|
||||
<div class="side-bar sidebar-additional showing" id="sidebar-additional">
|
||||
<% if Article.active_threads([@tag, "discuss"], Timeframer.new(params[:timeframe]).datetime).any? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>#discuss</h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<div class="widget-link-list">
|
||||
<% Article.active_threads([@tag, "discuss"], Timeframer.new(params[:timeframe]).datetime).each do |plucked_article| %>
|
||||
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if user_signed_in? %>
|
||||
<%= javascript_pack_tag "sidebarWidget", defer: true %>
|
||||
<div id="sidebarWidget__pack" data-tag-info="<%= @tag_model.attributes.slice("id", "text_color_hex", "bg_color_hex", "name").to_json %>">
|
||||
</div>
|
||||
<% else %>
|
||||
<% cache("seo-boostable-posts-for-tag-#{@tag}-#{params[:timeframe]}-xoxo", expires_in: 18.hours) do %>
|
||||
<% @boostable_posts = Article.seo_boostable(@tag, Timeframer.new(params[:timeframe]).datetime) %>
|
||||
<% if @boostable_posts.any? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>trending guides/resources</h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<div class="widget-link-list">
|
||||
<% @boostable_posts.each do |plucked_article| %>
|
||||
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if user_signed_in? %>
|
||||
<%= javascript_pack_tag "sidebarWidget", defer: true %>
|
||||
<div id="sidebarWidget__pack" data-tag-info="<%= @tag_model.attributes.slice("id", "text_color_hex", "bg_color_hex", "name").to_json %>">
|
||||
</div>
|
||||
<% else %>
|
||||
<% cache("seo-boostable-posts-for-tag-#{@tag}-#{params[:timeframe]}-xoxo", expires_in: 18.hours) do %>
|
||||
<% @boostable_posts = Article.seo_boostable(@tag, Timeframer.new(params[:timeframe]).datetime) %>
|
||||
<% if @boostable_posts.any? %>
|
||||
<div class="widget">
|
||||
<header>
|
||||
<h4>trending guides/resources</h4>
|
||||
</header>
|
||||
<div class="widget-body">
|
||||
<div class="widget-link-list">
|
||||
<% @boostable_posts.each do |plucked_article| %>
|
||||
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Loading…
Add table
Reference in a new issue