invoicing: admin and public views

Three admin templates:

- index: invoice list with status badge and link to detail.
- new: client + terms fields, dynamic line-item rows backed by
  admin-invoice-form.js (add/remove + re-index of items[N][...] names).
- show: invoice detail, public URL to share, toggle-paid button.

One public template, invoice_public.erb, shown at /i/:uuid: client name,
number, total, status, and a single big download button to /i/:uuid/pdf.

All admin pages are noindex; same for the public landing (it's a
client-specific URL, not search-discoverable content).
This commit is contained in:
Sergei Poljanski 2026-05-26 17:54:40 +03:00
commit 226ccb8192
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
5 changed files with 224 additions and 0 deletions

View file

@ -0,0 +1,41 @@
<div class="header">
<h1>Invoices</h1>
<p class="tagline"><a href="/admin/invoices/new">+ New invoice</a></p>
</div>
<% if @invoices.empty? %>
<section class="section">
<p>No invoices yet. <a href="/admin/invoices/new">Create the first one</a>.</p>
</section>
<% else %>
<section class="section">
<table class="invoice-list">
<thead>
<tr>
<th>Number</th>
<th>Client</th>
<th>Issued</th>
<th class="num">Total</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
<% @invoices.each do |inv| %>
<tr>
<td class="mono"><%= inv.number %></td>
<td><%= inv.client_name %></td>
<td class="mono"><%= inv.issued_on.strftime('%Y-%m-%d') %></td>
<td class="num mono"><%= inv.currency %> <%= '%.2f' % inv.total %></td>
<td>
<span class="badge badge-<%= inv.status %>"><%= inv.status %></span>
</td>
<td class="actions">
<a href="/admin/invoices/<%= inv.uuid %>">view</a>
</td>
</tr>
<% end %>
</tbody>
</table>
</section>
<% end %>