Compare commits
No commits in common. "43ef7fd395e224835c52e11e47ddf584e559fb3a" and "27a0235a06580ee3f8df097e6d04cba71446bc34" have entirely different histories.
43ef7fd395
...
27a0235a06
@ -1,32 +0,0 @@
|
|||||||
<%~ E.includeFile("partials/head.eta.html", {"title": "Settings - Category"}) %> <%~ E.includeFile("partials/controls.eta.html", {"active": "SETT_CAT"}) %>
|
|
||||||
|
|
||||||
<h1>All 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">Create new category</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Table with all categories -->
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">#</th>
|
|
||||||
<th scope="col">Name</th>
|
|
||||||
<th scope="col">Description</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% it.items.forEach(function(user){ %>
|
|
||||||
<tr>
|
|
||||||
<th scope="row"><%= user.id %></th>
|
|
||||||
<td><%= user.name %></td>
|
|
||||||
<td><%= user.description %></td> </tr>
|
|
||||||
<% }) %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%~ E.includeFile("partials/controlsFoot.eta.html") %> <%~ E.includeFile("partials/foot.eta.html") %>
|
|
@ -93,15 +93,6 @@
|
|||||||
<a class="nav-link <%= it.active == 'json_import' ? 'active' : ''%>" href="/import/json"> <i class="bi bi-filetype-json"></i>JSON Import </a>
|
<a class="nav-link <%= it.active == 'json_import' ? 'active' : ''%>" href="/import/json"> <i class="bi bi-filetype-json"></i>JSON Import </a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
|
|
||||||
<span>Settings</span>
|
|
||||||
<a class="link-secondary" href="#" aria-label="Add a new report"> </a>
|
|
||||||
</h6>
|
|
||||||
<ul class="nav flex-column mb-2">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link <%= it.active == 'SETT_CAT' ? 'active' : ''%>" href="/allCategories"><i class="bi bi-tag"></i> Manage categories </a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import express, { Request, Response } from 'express';
|
|
||||||
import { prisma, __path } from '../../index.js';
|
|
||||||
|
|
||||||
export default (req: Request, res: Response) => {
|
|
||||||
prisma.category
|
|
||||||
.findMany({})
|
|
||||||
.then((items) => {
|
|
||||||
// Count amount of total items
|
|
||||||
res.render(__path + '/src/frontend/categoryManager.eta.html', { items: items });
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).render(__path + '/src/frontend/errors/dbError.eta.html', { error: err });
|
|
||||||
});
|
|
||||||
};
|
|
@ -6,7 +6,6 @@ import testRoute from './test.js';
|
|||||||
import dashboardRoute from './dashboard.js';
|
import dashboardRoute from './dashboard.js';
|
||||||
import csvImportRoute from './import/csvImport.js';
|
import csvImportRoute from './import/csvImport.js';
|
||||||
import listAllItems from './listAllItems.js';
|
import listAllItems from './listAllItems.js';
|
||||||
import categoryManager from './categoryManager.js';
|
|
||||||
|
|
||||||
// Router base is '/'
|
// Router base is '/'
|
||||||
const Router = express.Router({ strict: false });
|
const Router = express.Router({ strict: false });
|
||||||
@ -14,7 +13,6 @@ const Router = express.Router({ strict: false });
|
|||||||
|
|
||||||
Router.use('/test', testRoute);
|
Router.use('/test', testRoute);
|
||||||
Router.use('/allItems', listAllItems)
|
Router.use('/allItems', listAllItems)
|
||||||
Router.use('/allCategories', categoryManager)
|
|
||||||
Router.use('/import/csv', csvImportRoute);
|
Router.use('/import/csv', csvImportRoute);
|
||||||
Router.use('/:id(\\w{8})', skuRoute);
|
Router.use('/:id(\\w{8})', skuRoute);
|
||||||
Router.use('/', dashboardRoute);
|
Router.use('/', dashboardRoute);
|
||||||
|
Loading…
Reference in New Issue
Block a user