feat: Add support for plain design help center layout (#7598)

This commit is contained in:
Pranav Raj S
2023-07-24 16:43:52 -07:00
committed by GitHub
parent d837065545
commit fa7bbdb0b3
9 changed files with 80 additions and 43 deletions

View File

@@ -11,7 +11,7 @@
<% end %>
<% end %>
<!-- The inline styles are intentional, migrate it to classes after upgrading to tailwind v3 -->
<% if !@is_plain_layout_enabled %>
<div class="bg-woot-50 py-8 shadow-inner" style="background: url(/assets/images/hc/grid.svg) color-mix(in srgb, <%= @portal.color %> 10%, white)">
<div class="max-w-6xl px-8 pt-8 pb-16 mx-auto space-y-4 w-full">
<div>
@@ -33,25 +33,15 @@
<span class="text-slate-700 leading-8 text-sm font-semibold" > Uncategorized </span>
<% end %>
</div>
<h1 class="text-3xl font-semibold md:tracking-normal leading-snug md:text-4xl text-slate-900">
<%= @article.title %>
</h1>
<div class="flex flex-col items-start justify-between w-full md:flex-row md:items-center pt-2">
<div class="flex items-center space-x-2">
<% if @article.author&.avatar_url&.present? %>
<div class="pr-1">
<img src="<%= @article.author.avatar_url %>" alt="<%= @article.author.display_name %>" class="w-12 h-12 border rounded-full">
</div>
<% end %>
<div>
<h5 class="text-base font-medium text-slate-900 mb-2"><%= @article.author.available_name %></h5>
<p class="text-sm font-normal text-slate-700">
<%= I18n.t('public_portal.common.last_updated_on', last_updated_on: @article.updated_at.strftime("%b %d, %Y")) %>
</div>
</div>
</div>
<%= render "public/api/v1/portals/articles/article_header", article: @article %>
</div>
</div>
<% else %>
<div class="max-w-6xl p-8 mx-auto space-y-4 w-full">
<%= render "public/api/v1/portals/articles/article_header", article: @article %>
</div>
<% end %>
<div class="flex max-w-6xl w-full px-8 mx-auto">
<article id="cw-article-content" class="flex-grow flex-2 py-12 mx-auto text-slate-800 text-lg max-w-3xl prose break-words">
<%= @parsed_content %>