<% title "Dashboard" %>

<%= t("core.dashboard") %>

<%= render "actions_mobile" %> <%= render "analytics" %>
<%= render "actions" %>
<% if params[:which] != "organization" %> <% if @articles.any?(&:archived) %> <%= link_to "Show archived", "javascript:;", id: "toggleArchivedLink", class: "crayons-btn crayons-btn--outlined whitespace-nowrap" %> <% end %> <% if @articles.any? %> <%= select_tag "dashboard_sort", options_for_select(sort_options, params[:sort]), "aria-label": "Sort By", class: "crayons-select w-auto" %> <% end %> <% end %> <% if @organizations && @organizations.size > 0 && (params[:which].blank? || params[:which] == "organization") %> <% end %>
<% if @articles.any? %> <%= javascript_packs_with_chunks_tag "dashboardDropdowns", defer: true %>
<% @articles.each do |article| %> <% if params[:which] == "organization" %> <%= render "dashboard_article_row", article: article, organization: article.organization, org_admin: true, manage_view: false %> <% else %> <%= render "dashboard_article_row", article: article, organization: nil, org_admin: false, manage_view: false %> <% end %> <% end %>
<%= paginate @articles, params: { i: nil } %>
<% else %>
<% if Settings::General.mascot_image_url.present? %> <% image_url = Images::Optimizer.call(Settings::General.mascot_image_url, width: 300, crop: "imagga_scale") %> <%= image_tag(image_url, class: "sloan mb-7", alt: "Mascot image") %> <% end %>

<%= t("dashboard.empty_post") %>

<%= t("dashboard.write_new_post") %>

<% end %>