mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-23 12:12:21 -05:00
102 lines
5.1 KiB
ERB
102 lines
5.1 KiB
ERB
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
|
<div class='container-fluid'>
|
|
<a class="navbar-brand ms-2" href="<%= root_path %>" aria-label="<%= translate ".home" %>">
|
|
<%= image_tag "roundel.svg", alt: translate("application.title"), height: "40px", class: "me-2" %>
|
|
<span class="d-lg-none"><%= t "application.title" %></span>
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="<%= translate ".navbar.toggler.label" %>">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse row" id="navbar">
|
|
<ul class="navbar-nav col-6 ps-4 ps-lg-0 align-self-start">
|
|
<li class="nav-item">
|
|
<%= nav_link "box", Model.model_name.human(count: 100), models_path(@filters) %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= nav_link "people", Creator.model_name.human(count: 100), creators_path(@filters&.except(:creator)) %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= nav_link "collection", Collection.model_name.human(count: 100), collections_path(@filters&.except(:collection)) %>
|
|
</li>
|
|
<% policy_scope(Library).find_each do |library| %>
|
|
<li class="nav-item">
|
|
<%= nav_link(
|
|
library.icon.presence || "boxes",
|
|
library.name,
|
|
models_path((@filters&.except(:library) || {}).merge({library: library.id})),
|
|
title: library.caption
|
|
) %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<ul class="navbar-nav col-6 pe-4 align-self-start justify-content-end">
|
|
<li class="nav-item">
|
|
<%= nav_link "plus-circle", t("libraries.general.new"), new_library_path, text_style: "d-lg-none" if policy(:library).new? %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<%= nav_link "upload", t(".upload"), new_model_path, style: "btn btn-warning btn-sm me-1 mt-lg-1" if policy(:upload).index? %>
|
|
</li>
|
|
<li class="nav-item">
|
|
<% if policy(:library).scan? %>
|
|
<% if @scan_in_progress %>
|
|
<%= nav_link "", t(".scanning"), "/activity", style: "btn btn-outline-warning btn-sm me-1 mt-lg-1", icon_style: "spinner-border spinner-border-sm" %>
|
|
<% else %>
|
|
<div class="btn-group">
|
|
<button type="button" data-bs-toggle="dropdown" aria-expanded="false"
|
|
class="btn btn-warning btn-sm mt-1 dropdown-toggle">
|
|
<%= t ".scan" %>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li><%= link_to t(".scan_changes"), scan_libraries_path, method: :post, class: "dropdown-item" %></li>
|
|
<li><%= link_to t(".check_existing"), scan_libraries_path(type: :check), method: :post, class: "dropdown-item" %>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</li>
|
|
<%- if current_user %>
|
|
<% if policy(Problem).index? && Problem.visible(current_user.problem_settings).count > 0 %>
|
|
<li class="nav-item">
|
|
<% severity = max_problem_severity %>
|
|
<%= 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-lg-none",
|
|
aria_label: Problem.model_name.human(count: 100) %>
|
|
</li>
|
|
<% end %>
|
|
<% if policy(:activity).index? %>
|
|
<li class="nav-item">
|
|
<%= nav_link "activity", t(".activity"), "/activity", text_style: "d-lg-none" %>
|
|
</li>
|
|
<% end %>
|
|
<li class="nav-item">
|
|
<%= nav_link "sliders", t(".settings"), user_settings_path(current_user), text_style: "d-lg-none" %>
|
|
</li>
|
|
<% end %>
|
|
<li class="nav-item">
|
|
<%= form_with url: models_path, method: :get, role: "search" do |f| %>
|
|
<%= f.search_field :q, class: "form-control ms-1 me-3", placeholder: translate(".search"), aria_label: translate(".search"), aria_describedby: "button-search", value: params[:q] %>
|
|
<% end %>
|
|
</li>
|
|
<%- if SiteSettings.multiuser_enabled? %>
|
|
<%- if current_user %>
|
|
<li class="nav-item">
|
|
<%= nav_link "person", t(".account"), edit_user_registration_path, text_style: "d-lg-none" %>
|
|
</li>
|
|
<% end %>
|
|
<li class="nav-item">
|
|
<%- if current_user %>
|
|
<%= nav_link "box-arrow-right", t(".log_out"), destroy_user_session_path, method: :delete, title: translate(".log_out"), text_style: "d-lg-none" %>
|
|
<% else %>
|
|
<%= nav_link "box-arrow-in-right", "", new_user_session_path, title: translate(".log_in") %>
|
|
<% end %>
|
|
</li>
|
|
<%- end %>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|