-
<% if policy(:upload).index? %>
<%= content_tag :button,
type: "button",
id: "nav-link-upload",
class: "btn btn-warning btn-sm mt-1 me-1 dropdown-toggle",
data: {
bs_toggle: "dropdown"
}.merge(tour_attributes(
id: "nav-link-upload",
title: t(".add_models"),
description: t("tour.navbar.add_models.description")
)),
aria: {
expanded: false,
haspopup: "menu",
controls: "add-content-menu"
} do
safe_join [Icon(icon: "plus-circle"), t(".add_models")], " "
end %>
<% end %>
-
<% if policy(:scan).create? %>
<% if @scan_in_progress %>
<%= nav_link "", t(".scanning"), activity_path, nofollow: true, style: "btn btn-outline-warning btn-sm me-1 mt-lg-1", icon_style: "spinner-border spinner-border-sm" %>
<% else %>
<% end %>
<% end %>
<%- if current_user %>
<% if policy(Problem).index? && Problem.visible(problem_settings).count > 0 %>
-
<% severity = max_problem_severity(policy_scope(Problem).all) %>
<%= nav_link problem_icon(severity),
Problem.model_name.human(count: 100),
problems_path,
title: translate("problems.severities.#{severity}"), # rubocop:todo I18n/RailsI18n/DecorateStringFormattingUsingInterpolation
icon_style: "link-#{severity}",
text_style: "d-md-none",
aria_label: Problem.model_name.human(count: 100) %>
<% end %>
<% if policy(:activity).index? %>
-
<%= nav_link "activity", t(".activity"), activity_path, nofollow: true, text_style: "d-md-none" %>
<% end %>
<% if policy(:settings).index? %>
-
<%= nav_link "gear", t(".settings"), settings_path, nofollow: true, text_style: "d-md-none" %>
<% end %>
<% if policy(:user).index? and not policy(:settings).index? %>
-
<%= nav_link "people", t(".moderator_settings"), settings_users_path, nofollow: true, text_style: "d-md-none" %>
<% end %>
<% end %>
<%- unless current_page?(root_path) %>
-
<%= form_with url: models_path, method: :get, role: "search" do |f| %>
<%= f.search_field :q, class: "form-control", placeholder: translate(".search"), aria_label: translate(".search"), aria_describedby: "button-search", value: @query || params[:q] %>
<% end %>
<% end %>
<%- if current_user %>
<%- if SiteSettings.multiuser_enabled? %>
-
<%= content_tag :button, id: "nav-link-preferences", title: t(".account"), class: "btn btn-light btn-sm mt-1",
data: {bs_toggle: "dropdown"}.merge(
tour_attributes(id: "nav-link-preferences", title: t(".account"), description: t("tour.navbar.account.description"))
),
aria: {
expanded: false,
haspopup: true,
controls: "preferences-menu"
} do %>
<%= Icon(icon: "person") %>
<% end %>
<% else %>
-
<%= nav_link "person", t("devise.registrations.edit.title"), edit_user_registration_path, nofollow: true, text_style: "d-md-none", id: "nav-link-preferences",
data: tour_attributes(id: "nav-link-preferences", title: t(".account"), description: t("tour.navbar.account.description")) %>
<% end %>
<% end %>
<%- if SiteSettings.multiuser_enabled? && current_user.nil? %>
-
<%= nav_link "box-arrow-in-right", t(".log_in"), new_user_session_path, title: translate(".log_in"), nofollow: true, style: "btn btn-light" %>
<%- end %>