Files
labelprint/views/_navbar.erb
T
randy 5c06f725f0
deploy / deploy (push) Successful in 9s
Address Brother QL printer by URL path instead of session cookie
Drops /brother/select and the session-based "active printer" state:
the printer key now lives in the path (/brother/<printer>/*), so the
proxy is stateless and any path under it -- including brother_ql_web's
API, not just its UI -- is reachable without a prior "activation" step.
2026-09-12 23:18:08 +02:00

25 lines
1.1 KiB
ERB

<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/">Print server</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/upload">Shipping labels</a>
</li>
</ul>
<span class="navbar-text me-2">Brother:</span>
<div class="d-flex gap-1">
<% BROTHER_PRINTERS.each do |key, info| %>
<a href="/brother/<%= key %>/" class="btn btn-sm <%= request.path.start_with?("/brother/#{key}/") ? 'btn-primary' : 'btn-outline-secondary' %>"><%= info[:label].sub('Brother ', '') %></a>
<% end %>
</div>
</div>
</div>
</nav>