57 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <%~ E.includeFile("../partials/head.eta.html", {"title": "Settings - Category"}) %> <%~ E.includeFile("../partials/controls.eta.html", {"active": "SETT_CAT"}) %> <%~ E.includeFile("../partials/deleteModal.eta.html") %>
 | |
| 
 | |
| <h1>Categories</h1>
 | |
| <div class="container">
 | |
| 	<!-- Create new category button -->
 | |
| 	<div class="row">
 | |
| 		<div class="col-12">
 | |
| 			<a href="/settings/category/new" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#editCategoryModal" onclick="primeCreateNew()">Create new category</a>
 | |
| 		</div>
 | |
| 	</div>
 | |
| 
 | |
| 	<div class="modal fade" id="editCategoryModal" tabindex="-1" aria-labelledby="editCategoryModal" 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="editCategoryModalLabel">Edit a category</h1>
 | |
| 					<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
 | |
| 				</div>
 | |
| 				<form class="frontendForm" method="patch" data-target="/api/v1/categories" id="CategoryModalForm">
 | |
| 					<div class="modal-body">
 | |
| 						<div class="mb-3">
 | |
| 							<label for="editCategoryModalName" class="form-label">Name</label>
 | |
| 							<input type="text" class="form-control" id="editCategoryModalName" maxlength="128" name="name" required />
 | |
| 							<div id="editCategoryModalNameText" class="form-text">This name should be unqiue.</div>
 | |
| 						</div>
 | |
| 						<div class="mb-3">
 | |
| 							<label for="editCategoryModalDescription" class="form-label">Description</label>
 | |
| 							<input type="text" class="form-control" id="editCategoryModalDescription" maxlength="2048" name="description" />
 | |
| 							<div id="editCategoryModalDescText" class="form-text">Optional</div>
 | |
| 						</div>
 | |
| 						<input type="text" id="editCategoryModalId" name="id" hidden />
 | |
| 					</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>
 | |
| 				</form>
 | |
| 			</div>
 | |
| 		</div>
 | |
| 	</div>
 | |
| 
 | |
| 	<!-- Table with all categories -->
 | |
| 	<table class="table align-middle" id="itemList" data-sortable="true" data-search-highlight="true" data-pagination="true" data-page-size="25" data-remember-order="true">
 | |
| 		<thead>
 | |
| 			<tr>
 | |
| 				<th scope="col" data-field="name" data-sortable="true" data-width="300">Name</th>
 | |
| 				<th scope="col" data-field="description" data-sortable="true">Description</th>
 | |
| 				<th scope="col" data-field="actions" data-sortable="false" data-searchable="false" data-width="160">Actions</th>
 | |
| 			</tr>
 | |
| 		</thead>
 | |
| 		
 | |
| 	</table>
 | |
| </div>
 | |
| <script src="/js/editCategory.js"></script>
 | |
| 
 | |
| <%~ E.includeFile("../partials/controlsFoot.eta.html") %> <%~ E.includeFile("../partials/foot.eta.html") %>
 |