* Rename SiteConfig * More renaming * Update spec * Update mandatory settings mapping * More renaming * e2e test fixes * You have a rename, and you have a rename * Spec fix * More changes * Temporarily disable specs * After-merge update * Undo rename for migration * undo rename of DUS * Fix DUS * Fix merge problem * Remove redundant DUS * Fix specs * Remove unused code * Change wrong class name * More cleanup * Re-add missing values to constant * Fix constant * Fix spec * Remove obsolete fields * Add accidentally removed field * Update spec * Move methods from Settings::General to ForemInstance * Remove unneeded model * Change mentions of 'site config'
87 lines
3.9 KiB
Text
87 lines
3.9 KiB
Text
<aside class="side-bar sidebar-additional showing grid gap-4" id="sidebar-additional">
|
|
<% cache(release_adjusted_cache_key("main-article-right-sidebar-discussions-#{params[:timeframe]}"), expires_in: (params[:timeframe].blank? ? 120 : 360).seconds) do %>
|
|
<% @sidebar_ad = DisplayAd.for_display("sidebar_right") %>
|
|
<% if @sidebar_ad %>
|
|
<div class="crayons-card crayons-card--secondary p-4 crayons-sponsorship-widget">
|
|
<%= @sidebar_ad.processed_html.html_safe %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= render "articles/sidebar_campaign" if Campaign.current.show_in_sidebar? %>
|
|
<% @listings = Listing.where(published: true).select(:title, :classified_listing_category_id, :slug, :bumped_at) %>
|
|
<% if params[:timeframe].blank? && @listings.any? %>
|
|
<section class="crayons-card crayons-card--secondary">
|
|
<header class="crayons-card__header">
|
|
<h3 class="crayons-subtitle-2">Listings</h3>
|
|
<div class="crayons-card__actions">
|
|
<a href="/listings" class="crayons-link--branded fw-medium fs-s">See all</a>
|
|
</div>
|
|
</header>
|
|
|
|
<div>
|
|
<% @listings.order(bumped_at: :desc).limit(5).each do |listing| %>
|
|
<a class="crayons-link crayons-link--contentful" href="<%= listing.path %>">
|
|
<div><%= listing.title %></div>
|
|
<div class="crayons-link__secondary"><%= listing.category %></div>
|
|
</a>
|
|
<% end %>
|
|
<a class="crayons-link crayons-link--branded block align-center p-3 fw-medium fs-s w-100" href="/listings/new">Create a Listing</a>
|
|
</div>
|
|
</section>
|
|
<% end %>
|
|
|
|
<% Settings::General.sidebar_tags.each do |tag| %>
|
|
<section class="crayons-card crayons-card--secondary">
|
|
<header class="crayons-card__header">
|
|
<h3 class="crayons-subtitle-2"><a href="/t/<%= tag %>" class="crayons-link">#<%= tag %></a></h3>
|
|
</header>
|
|
|
|
<div>
|
|
<% if tag == "help" %>
|
|
<% Article.active_help.limit(5).pluck(:path, :title, :comments_count, :created_at).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
<% else %>
|
|
<% active_threads(tags: [tag], time_ago: Timeframe.datetime(params[:timeframe]), count: 5).each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: true %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</section>
|
|
<% end %>
|
|
<% end %>
|
|
<% unless user_signed_in? %>
|
|
<% cache("seo-boostable-posts-homepage-#{params[:timeframe]}", expires_in: 18.hours) do %>
|
|
<% boostable_posts = Article.seo_boostable(nil, Timeframe.datetime(params[:timeframe])) %>
|
|
<% if boostable_posts.present? %>
|
|
<section 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>
|
|
</section>
|
|
<% end %>
|
|
<% recent_preamble_optimized_posts = Article.search_optimized(nil) %>
|
|
<% if params[:timeframe].blank? && recent_preamble_optimized_posts.present? %>
|
|
<section class="widget">
|
|
<header>
|
|
<h4>recently queried</h4>
|
|
</header>
|
|
<div class="widget-body">
|
|
<div class="widget-link-list">
|
|
<% recent_preamble_optimized_posts.each do |plucked_article| %>
|
|
<%= render "articles/widget_list_item", plucked_article: plucked_article, show_comment_count: false %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</aside>
|