228 lines
10 KiB
HTML
228 lines
10 KiB
HTML
<%~ E.includeFile("../partials/head.eta.html", {"title": "Settings - Storage Manager"}) %> <%~ E.includeFile("../partials/controls.eta.html", {"active": "SETT_STORE"}) %> <%~ E.includeFile("../partials/deleteModal.eta.html")
|
||
%>
|
||
|
||
<!-- Modal -->
|
||
<div class="modal fade" id="storageLocationModal" tabindex="-1" aria-labelledby="storageLocationModal" aria-hidden="true">
|
||
<div class="modal-dialog modal-dialog-centered">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h1 class="modal-title fs-5" id="storageLocationModalTitle">Edit or create a storage location</h1>
|
||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||
</div>
|
||
<form id="storageLocationModalForm" class="frontendForm" method="post" data-target="/api/v1/storageLocations">
|
||
<div class="modal-body">
|
||
<div class="mb-3">
|
||
<label for="storageLocationModalName" class="form-label">Name</label>
|
||
<input type="text" class="form-control" id="storageLocationModalName" name="name" maxlength="128" required />
|
||
<div id="storageLocationModalNameText" class="form-text">This name should be unqiue.</div>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label for="storageLocationModalUnit" class="form-label">Select a storage unit</label>
|
||
<select class="form-select" id="storageLocationModalUnit" name="storageUnitId" required>
|
||
<option value="undefined"><i>Do not assign a storage unit</i></option>
|
||
<% it.storUnits.forEach(function(storageunits){ %>
|
||
<option value="<%= storageunits.id %>"><%= storageunits.name %></option>
|
||
<% }) %>
|
||
</select>
|
||
|
||
<!--<input type="text" class="form-control" id="createNewCategoryModalDescription" name="description" />-->
|
||
<div id="storageLocationModalUnitText" class="form-text">You have to create a storage unit beforehand.</div>
|
||
<input type="hidden" id="storageLocationModalIdHidden" name="id" />
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||
</div>
|
||
<!-- loader overlay -->
|
||
<div class="loader-overlay">
|
||
<div class="loader">
|
||
<div class="spinner-border text-primary" role="status">
|
||
<span class="visually-hidden">Loading...</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="modal fade" id="storageUnitModal" tabindex="-1" aria-labelledby="storageUnitModal" aria-hidden="true">
|
||
<div class="modal-dialog modal-dialog-centered">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h1 class="modal-title fs-5" id="storageUnitModalLabel">Edit or create a storage unit</h1>
|
||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||
</div>
|
||
<form class="frontendForm" method="post" data-target="/api/v1/storageUnits" id="storageUnitModalForm">
|
||
<div class="modal-body">
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalName" class="form-label">Name</label>
|
||
<input type="text" class="form-control" id="storageUnitModalName" name="name" required />
|
||
<div id="storageUnitModalNameText" class="form-text">This name should be unqiue.</div>
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalLocationSelect" class="form-label">Storage Location</label>
|
||
<select class="form-select" id="storageUnitModalLocationSelect" name="locationId" onchange="handleSelector()" required>
|
||
<option value="META_CREATENEW" id="createNewLocationSelection">➕ Create new location</option>
|
||
<% it.address.forEach(function(address){ %>
|
||
<option value="<%= address.id %>"><%= address.street %> <%= address.houseNumber %>, <%= address.city %> <%= address.country %></option>
|
||
<% }) %>
|
||
</select>
|
||
|
||
<!--<input type="text" class="form-control" id="storageUnitModalLocationSelect" name="select" required />-->
|
||
<div id="storageUnitModalLocationSelectText" class="form-text">Select or create a new address.</div>
|
||
<input type="hidden" id="storageUnitModalLocationSelectHidden" name="id" />
|
||
</div>
|
||
|
||
<div id="storageUnitModalContactInfoCreator" class="d-none">
|
||
<hr />
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalStreet" class="form-label">Street</label>
|
||
<input type="text" class="form-control requireOnCreate" id="storageUnitModalStreet" name="street" />
|
||
<div id="storageUnitModalStreetText" class="form-text">Example Avenue</div>
|
||
</div>
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalHouseNumber" class="form-label">Housenumber</label>
|
||
<input type="text" class="form-control requireOnCreate" id="storageUnitModalHouseNumber" name="houseNumber" />
|
||
<div id="storageUnitModalHouseNumberText" class="form-text">6a</div>
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalzipcode" class="form-label">Zipcode</label>
|
||
<input type="text" class="form-control requireOnCreate" id="storageUnitModalzipcode" name="zipCode" />
|
||
<div id="storageUnitModalzipcodeText" class="form-text">123456</div>
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalCity" class="form-label">City</label>
|
||
<input type="text" class="form-control requireOnCreate" id="storageUnitModalCity" name="city" />
|
||
<div id="storageUnitModalCityText" class="form-text">Berlin</div>
|
||
</div>
|
||
|
||
<div class="mb-3">
|
||
<label for="storageUnitModalCountry" class="form-label">Country</label>
|
||
<input type="text" class="form-control requireOnCreate" id="storageUnitModalCountry" name="country" />
|
||
<div id="storageUnitModalCountryText" class="form-text">Germany</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||
</div>
|
||
<!-- loader overlay -->
|
||
<div class="loader-overlay">
|
||
<div class="loader">
|
||
<div class="spinner-border text-primary" role="status">
|
||
<span class="visually-hidden">Loading...</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<h1>Storages</h1>
|
||
<ul class="nav nav-underline" id="storageTabList" role="tablist">
|
||
<li class="nav-item" role="presentation">
|
||
<button class="nav-link active" id="storage-loc-tab" data-bs-toggle="tab" data-bs-target="#storage-loc-tab-pane" type="button" role="tab" aria-controls="storage-loc-tab-pane" aria-selected="true">
|
||
<i class="bi bi-bookshelf"></i> Storage Location
|
||
</button>
|
||
</li>
|
||
<li class="nav-item" role="presentation">
|
||
<button class="nav-link" id="storage-unit-tab" data-bs-toggle="tab" data-bs-target="#storage-unit-tab-pane" type="button" role="tab" aria-controls="storage-unit-tab-pane" aria-selected="false">
|
||
<i class="bi bi-buildings"></i> Storage Unit
|
||
</button>
|
||
</li>
|
||
</ul>
|
||
<div class="tab-content" id="storageTabListContent">
|
||
<div class="tab-pane fade show active" id="storage-loc-tab-pane" role="tabpanel" aria-labelledby="storage-loc-tab-pane" tabindex="0">
|
||
<br />
|
||
A storage location is a place where you can store your items. It can be a room, a shelf or a box.
|
||
<br />
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<a href="/settings/category/new" class="btn btn-primary" onclick="primeCreateNew()" data-bs-toggle="modal" data-bs-target="#storageLocationModal"
|
||
><i class="bi bi-plus-lg"></i> Create new Location</a
|
||
>
|
||
</div>
|
||
</div>
|
||
<table class="table align-middle">
|
||
<thead>
|
||
<tr>
|
||
<th scope="col">Name</th>
|
||
<th scope="col">Storage Unit</th>
|
||
<th scope="col">Actions</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<% it.storLocs.forEach(function(locations){ %>
|
||
<tr id="listEntry-<%= locations.id %>">
|
||
<td scope="row" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-title="ID: <%= locations.id %>"><%= locations.name %></td>
|
||
<td>
|
||
<% if (locations.storageUnit == null) { %>
|
||
<i>No storage unit connected</i>
|
||
<% } else { %> <%= locations.storageUnit.name %> <% } %>
|
||
</td>
|
||
<td>
|
||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#storageLocationModal" onclick="primeEdit(); getDataForEditLoc('<%= locations.id %>')">
|
||
<i class="bi bi-pencil"></i>
|
||
</button>
|
||
<button
|
||
class="btn btn-danger"
|
||
onclick="preFillDeleteModalNxt('<%= locations.id %>','storageLocations','Storage Location')"
|
||
data-bs-toggle="modal"
|
||
data-bs-target="#staticBackdrop">
|
||
<i class="bi bi-trash"></i>
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<% }) %>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<!-- Storage Unit -->
|
||
<div class="tab-pane fade" id="storage-unit-tab-pane" role="tabpanel" aria-labelledby="storage-unit-tab-pane" tabindex="0">
|
||
<br />
|
||
A storage unit is a physical place, like a warehouse. This contains an address and a name.
|
||
<br />
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<a class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#storageUnitModal" onclick="primeCreateNew()"><i class="bi bi-building-add"></i> Create new unit</a>
|
||
</div>
|
||
</div>
|
||
<table class="table align-middle">
|
||
<thead>
|
||
<tr>
|
||
<th scope="col">Name</th>
|
||
<th scope="col">Address</th>
|
||
<th scope="col">Actions</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<% it.storUnits.forEach(function(units){ %>
|
||
<tr id="listEntry-<%= units.id %>">
|
||
<td scope="row" data-bs-toggle="tooltip" data-bs-placement="left" data-bs-title="ID: <%= units.id %>"><%= units.name %></td>
|
||
<td><%= units.contactInfo.street %> <%= units.contactInfo.houseNumber %>, <%= units.contactInfo.city %> <%= units.contactInfo.country %></td>
|
||
<td>
|
||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#storageUnitModal" onclick="primeEdit(); getDataForEdit('<%= units.id %>')">
|
||
<i class="bi bi-pencil"></i>
|
||
</button>
|
||
<button class="btn btn-danger" onclick="preFillDeleteModalNxt('<%= units.id %>', 'storageUnits', 'Storage Unit')" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
|
||
<i class="bi bi-trash"></i>
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<% }) %>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
<script src="/js/editStorages.js"></script>
|
||
|
||
<%~ E.includeFile("../partials/controlsFoot.eta.html") %> <%~ E.includeFile("../partials/foot.eta.html") %>
|