The BIG frontend update
This commit is contained in:
		@@ -43,7 +43,7 @@
 | 
			
		||||
	</div>
 | 
			
		||||
 | 
			
		||||
	<!-- Table with all categories -->
 | 
			
		||||
	<table class="table">
 | 
			
		||||
	<table class="table align-middle">
 | 
			
		||||
		<thead>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<!-- <th scope="col">#</th> -->
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
				<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 class="frontendForm" method="post" data-target="/api/v1/storagelocation">
 | 
			
		||||
			<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>
 | 
			
		||||
@@ -18,7 +18,8 @@
 | 
			
		||||
					</div>
 | 
			
		||||
					<div class="mb-3">
 | 
			
		||||
						<label for="storageLocationModalUnit" class="form-label">Select a storage unit</label>
 | 
			
		||||
						<select class="form-select" id="storageLocationModalUnit" name="description" required>
 | 
			
		||||
						<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>
 | 
			
		||||
							<% }) %>
 | 
			
		||||
@@ -26,6 +27,7 @@
 | 
			
		||||
 | 
			
		||||
						<!--<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">
 | 
			
		||||
@@ -62,8 +64,8 @@
 | 
			
		||||
 | 
			
		||||
					<div class="mb-3">
 | 
			
		||||
						<label for="storageUnitModalLocationSelect" class="form-label">Storage Location</label>
 | 
			
		||||
						<select class="form-select" id="storageUnitModalLocationSelect" name="location" onchange="handleSelector()" required>
 | 
			
		||||
							<option value="META_CREATENEW">➕ Create new location</option>
 | 
			
		||||
						<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>
 | 
			
		||||
							<% }) %>
 | 
			
		||||
@@ -71,6 +73,7 @@
 | 
			
		||||
 | 
			
		||||
						<!--<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">
 | 
			
		||||
@@ -82,13 +85,13 @@
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="mb-3">
 | 
			
		||||
							<label for="storageUnitModalHouseNumber" class="form-label">Housenumber</label>
 | 
			
		||||
							<input type="text" class="form-control requireOnCreate" id="storageUnitModalHouseNumber" name="housenumber" />
 | 
			
		||||
							<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" />
 | 
			
		||||
							<input type="text" class="form-control requireOnCreate" id="storageUnitModalzipcode" name="zipCode" />
 | 
			
		||||
							<div id="storageUnitModalzipcodeText" class="form-text">123456</div>
 | 
			
		||||
						</div>
 | 
			
		||||
 | 
			
		||||
@@ -147,10 +150,9 @@
 | 
			
		||||
				>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<table class="table">
 | 
			
		||||
		<table class="table align-middle">
 | 
			
		||||
			<thead>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<th scope="col">LocId</th>
 | 
			
		||||
					<th scope="col">Name</th>
 | 
			
		||||
					<th scope="col">Storage Unit</th>
 | 
			
		||||
					<th scope="col">Actions</th>
 | 
			
		||||
@@ -160,18 +162,34 @@
 | 
			
		||||
				<% 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><%= locations.contactInfo %></td>
 | 
			
		||||
					<td>
 | 
			
		||||
						<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#storageLocationModal" onclick="primeEdit(); getDataForEdit('<%= locations.name %>')">
 | 
			
		||||
						<% 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="preFillDeleteModal('<%= locations.name %>')" data-bs-toggle="modal" data-bs-target="#staticBackdrop"><i class="bi bi-trash"></i></button>
 | 
			
		||||
						<button class="btn btn-danger" onclick="preFillDeleteModalLoc('<%= locations.id %>')" 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.
 | 
			
		||||
@@ -181,7 +199,7 @@
 | 
			
		||||
				<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">
 | 
			
		||||
		<table class="table align-middle">
 | 
			
		||||
			<thead>
 | 
			
		||||
				<tr>
 | 
			
		||||
					<th scope="col">Name</th>
 | 
			
		||||
@@ -195,10 +213,10 @@
 | 
			
		||||
					<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.name %>')">
 | 
			
		||||
						<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="preFillDeleteModal('<%= units.name %>')" data-bs-toggle="modal" data-bs-target="#staticBackdrop"><i class="bi bi-trash"></i></button>
 | 
			
		||||
						<button class="btn btn-danger" onclick="preFillDeleteModal('<%= units.id %>')" data-bs-toggle="modal" data-bs-target="#staticBackdrop"><i class="bi bi-trash"></i></button>
 | 
			
		||||
					</td>
 | 
			
		||||
				</tr>
 | 
			
		||||
				<% }) %>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user