Files
MiauInv/frontend/htmx/contents/dash/projects.html
2026-06-07 01:25:07 +02:00

84 lines
3.3 KiB
HTML

{{ define "content" }}
<div class="page-header action-bar">
<h1>Projects</h1>
<button class="btn btn-primary" style="width: auto; padding: 0.6rem 1.2rem; font-size: 0.95rem;" onclick="openProjectModal()">
New Project
</button>
</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th style="text-align: right;">Actions</th>
</tr>
</thead>
<tbody id="projects-table-body">
<tr><td colspan="3" class="table-loader">Loading projects...</td></tr>
</tbody>
</table>
</div>
<div id="project-modal" class="modal">
<div class="modal-content">
<h2 id="project-modal-title">New Project</h2>
<form id="project-form" onsubmit="saveProject(event)">
<input type="hidden" id="project-id">
<div class="form-group">
<input type="text" id="project-name" placeholder="Project Name" required>
</div>
<div class="form-group">
<input type="text" id="project-desc" placeholder="Description">
</div>
<div class="button-group">
<button type="submit" class="btn btn-primary">Save Project</button>
<button type="button" class="btn btn-secondary" onclick="closeModal('project-modal')">Cancel</button>
</div>
</form>
</div>
</div>
<div id="association-modal" class="modal">
<div class="modal-content large">
<h2 id="association-modal-title">Manage Project Items</h2>
<div class="modal-split">
<div>
<h3>Allocated Items</h3>
<div class="inner-table">
<table>
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
<th></th>
</tr>
</thead>
<tbody id="association-table-body">
</tbody>
</table>
</div>
</div>
<div>
<h3>Allocate New Item</h3>
<form id="association-form" onsubmit="saveAssociation(event)" style="margin-top: 1rem;">
<input type="hidden" id="assoc-project-id">
<div class="form-group">
<select id="assoc-item" class="search-input" style="width: 100%; padding: 0.85rem 1rem; background: #111827; color: white; border: 1px solid var(--border); border-radius: 10px;" required>
<option value="">Select Item...</option>
</select>
</div>
<div class="form-group">
<input type="number" id="assoc-qty" placeholder="Quantity needed" required>
</div>
<div class="button-group">
<button type="submit" class="btn btn-primary">Allocate</button>
<button type="button" class="btn btn-secondary" onclick="closeModal('association-modal')">Done</button>
</div>
</form>
</div>
</div>
</div>
</div>
{{ end }}