<% if current_user && (current_user.admin? || current_user.moderator?) %> <% end %>
<% SupportCategory.sorted.each do |category| %>
<%= support_link_to help_center.support_category_path(category) do %>
<%= category.name %>
<% end %>
<% threads = SupportThread.where(support_category_id: category.id).order(:position) %> <% threads.each do |thread| %>
<%= support_link_to help_center.support_thread_path(thread) do %> <%= thread.title %> <% end %>
<% end %>
<% end %>
<% if HelpCenter.enable_comments %>
<%= t('filters') %>
<%= support_link_to help_center.support_threads_path, exact: true do %> <%= icon "fa-fw fas", "bars" %> <%= t('.all_threads') %> <% end %>
<% if user_signed_in? %>
<%= support_link_to help_center.mine_support_threads_path do %><%= icon "fa-fw far", "user-circle" %> <%= t('.my_questions') %> <% end %>
<%= support_link_to help_center.participating_support_threads_path do %> <%= icon "fa-fw far", "comments" %> <%= t('.participating') %> <% end %>
<% end %>
<%= support_link_to help_center.answered_support_threads_path do %> <%= icon "fa-fw fas", "check" %> <%= t('.answered') %> <% end %>
<%= support_link_to help_center.unanswered_support_threads_path do %> <%= icon "fa-fw fas", "question" %> <%= t('.unanswered') %> <% end %>
<% if @support_thread.present? && @support_thread.persisted? %>
<%# User has not posted in the thread or subscribed %>
<%= t('.notifications') %>
<%= link_to help_center.support_thread_notifications_path(@support_thread), method: :post, class: "btn-secondary btn-sm btn-block mb-2" do %> <% if @support_thread.subscribed? current_user %> <%= icon "fa-fw fas", "bell-slash" %> <%= t('.unsubscribe') %> <% else %> <%= icon "fa-fw fas", "bell" %> <%= t('.suscribe') %> <% end %> <% end %> <%= @support_thread.subscribed_reason(current_user) %> <% end %> <% end %>
<%# Show first article by default on home pag %> <% if current_page?(help_center_path) %> <% if SupportCategory.all.count > 0 %> <% @support_thread = SupportCategory.sorted.first.support_threads.sorted.first %>
<% if is_moderator_or_owner?(@support_thread) %>
<%= link_to icon("fas","pencil"), help_center.edit_support_thread_path(@support_thread), class: "text-muted", data: { toggle: "tooltip", placement: "left" }, title: t('edit_this_thread') %>
<% end %>
<%= support_category_link(@support_thread.support_category) %> > <%= @support_thread.title %>

<%= icon "fas", "thumb-tack", class: "text-muted" if @support_thread.pinned? %> <%= @support_thread.title %>

<%= @support_thread.content %>
<% end %> <% end %> <%= yield %>
<% parent_layout("application") %>