express-sweet-generator 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/README.md +14 -42
  3. package/bin/express-sweet-cli.js +220 -217
  4. package/package.json +1 -1
  5. package/templates/cjs/config/authentication.js +16 -2
  6. package/templates/cjs/config/database.js +6 -12
  7. package/templates/cjs/ecosystem.config.js.ejs +5 -1
  8. package/templates/cjs/public/assets/home.css +0 -0
  9. package/templates/cjs/public/assets/home.js +0 -0
  10. package/templates/cjs/public/assets/{styles/login.css → login.css} +0 -2
  11. package/templates/cjs/public/assets/{scripts/login.js → login.js} +0 -3
  12. package/templates/cjs/public/assets/{images/logo.svg → logo.svg} +0 -0
  13. package/templates/cjs/public/assets/user.css +0 -0
  14. package/templates/cjs/public/assets/{scripts/user.js → user.js} +0 -3
  15. package/templates/cjs/public/assets/users.css +0 -0
  16. package/templates/cjs/public/assets/{scripts/users.js → users.js} +11 -9
  17. package/templates/cjs/routes/api/users.js +7 -33
  18. package/templates/cjs/routes/home.js +0 -3
  19. package/templates/cjs/routes/login.js +0 -3
  20. package/templates/cjs/routes/users.js +3 -9
  21. package/templates/cjs/views/error.hbs +1 -2
  22. package/templates/cjs/views/home.hbs +2 -8
  23. package/templates/cjs/views/layout/default.hbs +13 -18
  24. package/templates/cjs/views/login.hbs +4 -15
  25. package/templates/cjs/views/user.hbs +9 -16
  26. package/templates/cjs/views/users.hbs +5 -17
  27. package/templates/esm/config/authentication.js +16 -1
  28. package/templates/esm/config/database.js +6 -12
  29. package/templates/esm/ecosystem.config.js.ejs +5 -1
  30. package/templates/esm/public/assets/home.css +0 -0
  31. package/templates/esm/public/assets/home.js +0 -0
  32. package/templates/esm/public/assets/{styles/login.css → login.css} +0 -2
  33. package/templates/esm/public/assets/{scripts/login.js → login.js} +0 -3
  34. package/templates/esm/public/assets/{images/logo.svg → logo.svg} +0 -0
  35. package/templates/esm/public/assets/user.css +0 -0
  36. package/templates/esm/public/assets/{scripts/user.js → user.js} +0 -3
  37. package/templates/esm/public/assets/users.css +0 -0
  38. package/templates/esm/public/assets/{scripts/users.js → users.js} +11 -9
  39. package/templates/esm/routes/api/users.js +7 -33
  40. package/templates/esm/routes/home.js +0 -3
  41. package/templates/esm/routes/login.js +0 -3
  42. package/templates/esm/routes/users.js +3 -9
  43. package/templates/esm/views/error.hbs +1 -2
  44. package/templates/esm/views/home.hbs +2 -8
  45. package/templates/esm/views/layout/default.hbs +13 -18
  46. package/templates/esm/views/login.hbs +4 -15
  47. package/templates/esm/views/user.hbs +9 -16
  48. package/templates/esm/views/users.hbs +5 -17
  49. package/templates/cjs/public/assets/images/logo-dark.svg +0 -12
  50. package/templates/cjs/public/assets/scripts/docs.js +0 -1
  51. package/templates/cjs/public/assets/scripts/home.js +0 -3
  52. package/templates/cjs/public/assets/styles/docs.css +0 -2200
  53. package/templates/cjs/public/assets/styles/home.css +0 -1
  54. package/templates/cjs/public/assets/styles/user.css +0 -1
  55. package/templates/cjs/public/assets/styles/users.css +0 -1
  56. package/templates/esm/public/assets/images/logo-dark.svg +0 -12
  57. package/templates/esm/public/assets/scripts/docs.js +0 -1
  58. package/templates/esm/public/assets/scripts/home.js +0 -3
  59. package/templates/esm/public/assets/styles/docs.css +0 -2200
  60. package/templates/esm/public/assets/styles/home.css +0 -1
  61. package/templates/esm/public/assets/styles/user.css +0 -1
  62. package/templates/esm/public/assets/styles/users.css +0 -1
@@ -1,6 +1,3 @@
1
- /*User list page script*/
2
-
3
- // Main processing.
4
1
  // Set up data table.
5
2
  const dt = $('#table')
6
3
  .on('draw.dt', () => {
@@ -14,23 +11,28 @@ const dt = $('#table')
14
11
  // URL to get list data.
15
12
  url: '/api/users',
16
13
  // Set action column elements.
17
- dataSrc: res => res.data.map(row => Object.assign(row, {actions: ''})),
14
+ dataSrc: res => {
15
+ return res.data.map(row => Object.assign(row, {actions: ''}));
16
+ },
18
17
  // For Ajax, send a cookie.
19
- xhrFields: {withCredentials: true}
18
+ xhrFields: {
19
+ withCredentials: true
20
+ }
20
21
  },
21
22
  columns: [
22
- {data: 'id', width: 30},
23
+ {data: 'id', width: 100},
23
24
  {data: 'email'},
24
25
  {data: 'name'},
25
26
  {data: 'modified', width: 200},
26
- {data: 'actions', width: 150}
27
+ {data: 'actions', width: 200}
27
28
  ],
28
29
  columnDefs: [
29
30
  {
30
31
  targets: -1,
31
32
  orderable: false,
32
- render: (data, type, row) => `<a href="/users/${row.id}" class="btn btn-success">Edit</a>
33
- <button on-delete data-id="${row.id}" type="button" class="btn btn-danger mx-2">Delete</button>`
33
+ render: (data, type, row) =>
34
+ `<a href="/users/${row.id}" class="btn btn-success">Edit</a>
35
+ <button on-delete data-id="${row.id}" type="button" class="btn btn-danger mx-2">Delete</button>`
34
36
  }
35
37
  ],
36
38
  dom: `<'row'<'col-12'f>><'row'<'col-12'tr>><'row'<'col-12 dataTables_pager'p>>`,
@@ -4,34 +4,19 @@ import UserModel from '../../models/UserModel';
4
4
  const router = Router();
5
5
  const Authentication = sweet.services.Authentication;
6
6
 
7
- /**
8
- * Login.
9
- */
7
+ // Login.
10
8
  router.post('/login', async (req, res, next) => {
11
- // Authenticate with username and password.
12
9
  const isAuthenticated = await Authentication.authenticate(req, res, next);
13
-
14
- // For asynchronous requests.Returns the authentication result and executes subsequent processing on the front end.
15
10
  res.json(isAuthenticated);
16
-
17
- // // For sync request.If the authentication is successful, you will be redirected to the authentication success page, and if it is unsuccessful, you will be redirected to the login page.
18
- // if (isAuthenticated)
19
- // Authentication.successRedirect(res);
20
- // else
21
- // Authentication.failureRedirect(res);
22
11
  });
23
12
 
24
- /**
25
- * Logout.
26
- */
13
+ // Logout.
27
14
  router.get('/logout', (req, res) => {
28
15
  Authentication.logout(req);
29
16
  res.redirect('/');
30
17
  });
31
18
 
32
- /**
33
- * List Users.
34
- */
19
+ // Get a list of users.
35
20
  router.get('/', async (req, res) => {
36
21
  const data = await UserModel.paginate({
37
22
  offset: req.query.offset,
@@ -44,9 +29,7 @@ router.get('/', async (req, res) => {
44
29
  res.json(data);
45
30
  });
46
31
 
47
- /**
48
- * Create a User.
49
- */
32
+ // Create User.
50
33
  router.post('/', async (req, res) => {
51
34
  // Email duplication check.
52
35
  const emailExists = (await UserModel.count({
@@ -70,9 +53,7 @@ router.post('/', async (req, res) => {
70
53
  res.json({id: result.id});
71
54
  });
72
55
 
73
- /**
74
- * Update a User.
75
- */
56
+ // Update User.
76
57
  router.put('/:id(\\d+)', async (req, res) => {
77
58
  // Email duplication check.
78
59
  const emailExists = (await UserModel.count({
@@ -108,16 +89,9 @@ router.put('/:id(\\d+)', async (req, res) => {
108
89
  res.json(true);
109
90
  });
110
91
 
111
- /**
112
- * Delete a User.
113
- */
92
+ // Delete user.
114
93
  router.delete('/:id(\\d+)', async (req, res) => {
115
- // Delete user data that matches the ID.
116
- await UserModel.destroy({
117
- where: {
118
- id: req.params.id
119
- }
120
- });
94
+ await UserModel.destroy({where: {id: req.params.id}});
121
95
  res.json(true);
122
96
  });
123
97
 
@@ -1,9 +1,6 @@
1
1
  import {Router} from 'express';
2
2
  const router = Router();
3
3
 
4
- /**
5
- * Home page.
6
- */
7
4
  router.get('/', (req, res) => {
8
5
  res.render('home');
9
6
  });
@@ -1,9 +1,6 @@
1
1
  import {Router} from 'express';
2
2
  const router = Router();
3
3
 
4
- /**
5
- * Login page.
6
- */
7
4
  router.get('/', (req, res) => {
8
5
  res.render('login');
9
6
  });
@@ -2,9 +2,7 @@ import {Router} from 'express';
2
2
  import UserModel from '../models/UserModel';
3
3
  const router = Router();
4
4
 
5
- /**
6
- * User edit page.
7
- */
5
+ // Edit User.
8
6
  router.get('/:id(\\d+)', async (req, res) => {
9
7
  // Find a user that matches your ID.
10
8
  const user = await UserModel.findByPk(req.params.id, {
@@ -20,16 +18,12 @@ router.get('/:id(\\d+)', async (req, res) => {
20
18
  res.render('user', {user, edit: true});
21
19
  });
22
20
 
23
- /**
24
- * User addition page.
25
- */
21
+ // Create User.
26
22
  router.get('/new', async (req, res) => {
27
23
  res.render('user', {edit: false});
28
24
  });
29
25
 
30
- /**
31
- * Users page.
32
- */
26
+ // User List.
33
27
  router.get('/', async (req, res) => {
34
28
  res.render('users');
35
29
  });
@@ -1,5 +1,4 @@
1
1
  {{!< default}}
2
-
3
2
  <h1>{{message}}</h1>
4
3
  <h2>{{error.status}}</h2>
5
- <pre>{{error.stack}}</pre>
4
+ <pre>{{error.stack}}</pre>
@@ -1,11 +1,5 @@
1
1
  {{!< default}}
2
2
  {{#contentFor 'title'}}Home{{/contentFor}}
3
- {{#contentFor 'style'}}
4
- <link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/styles/home.css' baseUrl}}">
5
- <!-- <link rel="stylesheet" type="text/css" href="{{baseUrl}}/assets/styles/home.css"> -->
6
- {{/contentFor}}
7
- {{#contentFor 'script'}}
8
- <script src="{{cache_busting '/assets/scripts/home.js' baseUrl}}"></script>
9
- <!-- <script src="{{baseUrl}}/assets/scripts/home.js"></script> -->
10
- {{/contentFor}}
3
+ {{#contentFor 'style'}}<link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/home.css' baseUrl}}">{{/contentFor}}
4
+ {{#contentFor 'script'}}<script src="{{cache_busting '/assets/home.js' baseUrl}}"></script>{{/contentFor}}
11
5
  <h1 class="mt-5 text-center">Welcome to Express Sweet</h1>
@@ -3,27 +3,25 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>{{{block "title"}}} | Sample</title>
7
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
8
- <link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/styles/docs.css' baseUrl}}">
9
- <!-- <link rel="stylesheet" type="text/css" href="{{baseUrl}}/assets/styles/docs.css"> -->
6
+ <title>{{{block "title"}}} | Exspress Sweet Template</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
8
+ <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/dataTables.bootstrap5.min.css">
10
9
  {{{block "style"}}}
11
10
  </head>
12
11
  <body>
13
12
  {{#if session}}
14
- <header class="navbar navbar-expand-md navbar-dark bd-navbar">
15
- <!-- <header class="navbar navbar-expand-md navbar-light bg-light"> -->
13
+ <header class="navbar navbar-expand-md navbar-light">
16
14
  <nav class="container-xxl flex-wrap flex-md-nowrap" aria-label="Main navigation">
17
- <a class="navbar-brand p-0 me-2" href="{{baseUrl}}">
18
- <img src="{{baseUrl}}/assets/images/logo-dark.svg" height="50">
15
+ <a class="navbar-brand p-0 me-2" href="/">
16
+ <img src="{{baseUrl}}/assets/logo.svg" height="32">
19
17
  </a>
20
18
  <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#bdNavbar" aria-controls="bdNavbar" aria-expanded="false" aria-label="Toggle navigation">
21
19
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" class="bi" fill="currentColor" viewBox="0 0 16 16">
22
- <path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/>
20
+ <path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path>
23
21
  </svg>
24
22
  </button>
25
23
  <div class="collapse navbar-collapse" id="bdNavbar">
26
- <ul class="navbar-nav flex-row flex-wrap bd-navbar-nav pt-2 py-md-0">
24
+ <ul class="navbar-nav flex-row flex-wrap pt-2 py-md-0">
27
25
  <li class="nav-item col-6 col-md-auto">
28
26
  <a class="nav-link p-2 {{#if (eq currentPath '/')}}active{{/if}}" href="{{baseUrl}}">Home</a>
29
27
  </li>
@@ -31,7 +29,7 @@
31
29
  <a class="nav-link p-2 {{#if (eq currentPath '/users')}}active{{/if}}" href="{{baseUrl}}/users">Users</a>
32
30
  </li>
33
31
  </ul>
34
- <a class="btn btn-bd-primary d-lg-inline-block my-2 my-md-0 ms-md-auto" href="{{baseUrl}}/api/users/logout">Logout</a>
32
+ <a class="my-md-0 ms-md-auto" href="{{baseUrl}}/api/users/logout">Logout</a>
35
33
  </div>
36
34
  </nav>
37
35
  </header>
@@ -41,22 +39,19 @@
41
39
  {{else}}
42
40
  {{{body}}}
43
41
  {{/if}}
44
-
45
42
  <script>
46
43
  // Application base URL.
47
44
  globalThis.baseUrl = '{{baseUrl}}';
48
-
49
45
  // User session.
50
46
  {{#if session}}
51
47
  globalThis.$$session = {{{json_stringify session}}};
52
48
  {{/if}}
53
49
  </script>
54
-
55
50
  <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
56
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
57
- <script src="{{cache_busting '/assets/scripts/docs.js' baseUrl}}"></script>
58
- <!-- <script src="{{baseUrl}}/assets/scripts/docs.js"></script> -->
59
-
51
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
52
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js" integrity="sha512-UdIMMlVx0HEynClOIFSyOrPggomfhBKJE28LKl8yR3ghkgugPnG6iLfRfHwushZl1MOPSY6TsuBDGPK2X4zYKg==" crossorigin="anonymous"></script>
53
+ <script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
54
+ <script src="https://cdn.datatables.net/1.10.24/js/dataTables.bootstrap5.min.js"></script>
60
55
  {{{block "script"}}}
61
56
  </body>
62
57
  </html>
@@ -1,23 +1,12 @@
1
1
  {{!< default}}
2
2
  {{#contentFor 'title'}}Login{{/contentFor}}
3
- {{#contentFor 'style'}}
4
- <link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/styles/login.css' baseUrl}}">
5
- <!-- <link rel="stylesheet" type="text/css" href="{{baseUrl}}/assets/styles/login.css"> -->
6
- {{/contentFor}}
7
- {{#contentFor 'script'}}
8
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js" integrity="sha512-UdIMMlVx0HEynClOIFSyOrPggomfhBKJE28LKl8yR3ghkgugPnG6iLfRfHwushZl1MOPSY6TsuBDGPK2X4zYKg==" crossorigin="anonymous"></script>
9
- <script src="{{cache_busting '/assets/scripts/login.js' baseUrl}}"></script>
10
- <!-- <script src="{{baseUrl}}/assets/scripts/login.js"></script> -->
11
- {{/contentFor}}
12
- <form id="form" class="w-100 mx-auto my-0 login-form needs-validation">
13
- <!-- <form method="post" action="/api/users/login" class="w-100 mx-auto my-0 login-form needs-validation"> -->
14
- <div class="text-center">
15
- <img class="mb-4" src="{{baseUrl}}/assets/images/logo.svg" height="100">
16
- </div>
3
+ {{#contentFor 'style'}}<link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/login.css' baseUrl}}">{{/contentFor}}
4
+ {{#contentFor 'script'}}<script src="{{cache_busting '/assets/login.js' baseUrl}}"></script>{{/contentFor}}
5
+ <form id="form" class="w-100 mx-auto my-0 login-form">
17
6
  <h1 class="h3 mb-3 font-weight-normal text-center">Please login</h1>
18
7
  <div class="mb-3">
19
8
  <label class="form-label">Email address</label>
20
- <input type="email" class="form-control" name="email" required autofocus value="robin@example.com" placeholder="name@example.com">
9
+ <input type="email" class="form-control" name="email" required autofocus value="robin@example.com">
21
10
  </div>
22
11
  <div class="mb-3">
23
12
  <label class="form-label">Password</label>
@@ -1,23 +1,16 @@
1
1
  {{!< default}}
2
- {{#contentFor 'title'}}Dashboard{{/contentFor}}
3
- {{#contentFor 'style'}}
4
- <link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/styles/user.css' baseUrl}}">
5
- <!-- <link rel="stylesheet" type="text/css" href="{{baseUrl}}/assets/styles/user.css"> -->
6
- {{/contentFor}}
7
- {{#contentFor 'script'}}
8
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js" integrity="sha512-UdIMMlVx0HEynClOIFSyOrPggomfhBKJE28LKl8yR3ghkgugPnG6iLfRfHwushZl1MOPSY6TsuBDGPK2X4zYKg==" crossorigin="anonymous"></script>
9
- <script src="{{cache_busting '/assets/scripts/user.js' baseUrl}}"></script>
10
- <!-- <script src="{{baseUrl}}/assets/scripts/user.js"></script> -->
11
- {{/contentFor}}
2
+ {{#contentFor 'title'}}User Information{{/contentFor}}
3
+ {{#contentFor 'style'}}<link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/user.css' baseUrl}}">{{/contentFor}}
4
+ {{#contentFor 'script'}}<script src="{{cache_busting '/assets/user.js' baseUrl}}"></script>{{/contentFor}}
12
5
  <div class="row justify-content-center">
13
6
  <div class="col-12 col-md-7">
14
- <h3 class="font-weight-bold text-dark">
15
- {{ifx edit 'Edit user:' 'New user:'}}
7
+ <h3 class="font-weight-bold">
8
+ {{ifx edit 'Edit a user' 'Create a new user'}}
16
9
  </h3>
17
10
  <form id="form">
18
11
  <div class="mb-3">
19
- <label class="form-label">Email address</label>
20
- <input type="email" class="form-control" name="email" value="{{user.email}}" required autofocus placeholder="name@example.com">
12
+ <label class="form-label">Email</label>
13
+ <input type="email" class="form-control" name="email" value="{{user.email}}" required autofocus>
21
14
  </div>
22
15
  <div class="mb-3">
23
16
  <label class="form-label">Name</label>
@@ -31,8 +24,8 @@
31
24
  {{/if}}
32
25
  </div>
33
26
  <div class="d-flex justify-content-between mt-3">
34
- <a href="{{baseUrl}}/users" class="btn btn-secondary">Return to user list</a>
35
- <button type="submit" class="btn btn-primary">Save user data</button>
27
+ <a href="{{baseUrl}}/users" class="btn btn-secondary">Back to User List</a>
28
+ <button type="submit" class="btn btn-primary">Save user information</button>
36
29
  </div>
37
30
  </form>
38
31
  </div>
@@ -1,26 +1,14 @@
1
1
  {{!< default}}
2
- {{#contentFor 'title'}}Dashboard{{/contentFor}}
3
- {{#contentFor 'style'}}
4
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/dataTables.bootstrap5.min.css">
5
- <link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/styles/users.css' baseUrl}}">
6
- <!-- <link rel="stylesheet" type="text/css" href="{{baseUrl}}/assets/styles/users.css"> -->
7
- {{/contentFor}}
8
- {{#contentFor 'script'}}
9
- <script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
10
- <script src="https://cdn.datatables.net/1.10.24/js/dataTables.bootstrap5.min.js"></script>
11
- <script src="{{cache_busting '/assets/scripts/users.js' baseUrl}}"></script>
12
- <!-- <script src="{{baseUrl}}/assets/scripts/users.js"></script> -->
13
- {{/contentFor}}
14
-
2
+ {{#contentFor 'title'}}User Management{{/contentFor}}
3
+ {{#contentFor 'style'}}<link rel="stylesheet" type="text/css" href="{{cache_busting '/assets/users.css' baseUrl}}">{{/contentFor}}
4
+ {{#contentFor 'script'}}<script src="{{cache_busting '/assets/users.js' baseUrl}}"></script>{{/contentFor}}
15
5
  <div class="d-flex mb-4">
16
- <h3 class="font-weight-bold text-dark">User list:</h3>
17
- <a href="/users/new" class="btn btn-primary" style="margin-left: auto;">Add New</a>
6
+ <a href="/users/new" class="btn btn-primary ms-auto">Create new user</a>
18
7
  </div>
19
-
20
8
  <table class="table w-100" id="table">
21
9
  <thead>
22
10
  <tr>
23
- <th scope="col">ID</th>
11
+ <th scope="col">User ID</th>
24
12
  <th scope="col">Email</th>
25
13
  <th scope="col">Name</th>
26
14
  <th scope="col">Modified</th>
@@ -1,12 +0,0 @@
1
- <svg width="512" height="294" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet">
2
- <!-- <svg width="512" height="145" viewBox="0 0 512 145" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet"> -->
3
- <g>
4
- <g fill="#83CD29" id="svg_1">
5
- <path d="m471.05,51.611c-1.244,0 -2.454,0.257 -3.525,0.863l-33.888,19.57c-2.193,1.264 -3.526,3.65 -3.526,6.189l0,39.069c0,2.537 1.333,4.92 3.526,6.187l8.85,5.109c4.3,2.119 5.885,2.086 7.842,2.086c6.366,0 10.001,-3.863 10.001,-10.576l0,-38.566c0,-0.545 -0.472,-0.935 -1.007,-0.935l-4.245,0c-0.544,0 -1.007,0.39 -1.007,0.935l0,38.566c0,2.975 -3.1,5.968 -8.13,3.453l-9.21,-5.396c-0.326,-0.177 -0.576,-0.49 -0.576,-0.863l0,-39.07c0,-0.37 0.247,-0.747 0.576,-0.935l33.816,-19.497a0.998,0.998 0 0 1 1.007,0l33.817,19.498c0.322,0.194 0.576,0.553 0.576,0.936l0,39.069c0,0.373 -0.188,0.755 -0.504,0.935l-33.889,19.498c-0.29,0.173 -0.69,0.173 -1.007,0l-8.706,-5.18a0.905,0.905 0 0 0 -0.863,0c-2.403,1.362 -2.855,1.52 -5.109,2.302c-0.555,0.194 -1.398,0.495 0.288,1.44l11.368,6.69a6.995,6.995 0 0 0 3.526,0.936a6.949,6.949 0 0 0 3.525,-0.935l33.889,-19.499c2.193,-1.275 3.525,-3.65 3.525,-6.187l0,-39.07c0,-2.538 -1.332,-4.92 -3.525,-6.187l-33.889,-19.57c-1.062,-0.607 -2.28,-0.864 -3.525,-0.864l-0.001,-0.001z" id="svg_2"/>
6
- <path d="m480.116,79.528c-9.65,0 -15.397,4.107 -15.397,10.937c0,7.408 5.704,9.444 14.966,10.36c11.08,1.085 11.943,2.712 11.943,4.893c0,3.783 -3.016,5.396 -10.144,5.396c-8.957,0 -10.925,-2.236 -11.584,-6.691c-0.078,-0.478 -0.447,-0.864 -0.936,-0.864l-4.389,0c-0.54,0 -1.007,0.466 -1.007,1.008c0,5.703 3.102,12.447 17.916,12.447c10.723,0 16.908,-4.209 16.908,-11.584c0,-7.31 -4.996,-9.273 -15.398,-10.648c-10.51,-1.391 -11.512,-2.072 -11.512,-4.533c0,-2.032 0.85,-4.75 8.634,-4.75c6.954,0 9.524,1.5 10.577,6.189c0.092,0.44 0.48,0.791 0.935,0.791l4.39,0c0.27,0 0.532,-0.166 0.719,-0.36c0.184,-0.207 0.314,-0.44 0.288,-0.719c-0.68,-8.074 -6.064,-11.872 -16.909,-11.872z" id="svg_3"/>
7
- </g>
8
- <path d="m271.821,0.383a2.181,2.181 0 0 0 -1.08,0.287a2.18,2.18 0 0 0 -1.079,1.871l0,55.042c0,0.54 -0.251,1.024 -0.719,1.295a1.501,1.501 0 0 1 -1.511,0l-8.994,-5.18a4.31,4.31 0 0 0 -4.317,0l-35.903,20.721c-1.342,0.775 -2.158,2.264 -2.158,3.814l0,41.443c0,1.548 0.817,2.966 2.158,3.741l35.903,20.722a4.3,4.3 0 0 0 4.317,0l35.903,-20.722a4.308,4.308 0 0 0 2.159,-3.741l0,-103.32a4.386,4.386 0 0 0 -2.23,-3.814l-21.37,-11.944c-0.335,-0.187 -0.707,-0.22 -1.079,-0.215zm-230.96,51.732c-0.684,0.027 -1.328,0.147 -1.942,0.503l-35.904,20.722a4.3,4.3 0 0 0 -2.158,3.741l0.072,55.619c0,0.773 0.399,1.492 1.079,1.87a2.096,2.096 0 0 0 2.159,0l21.297,-12.231c1.349,-0.802 2.23,-2.196 2.23,-3.742l0,-25.974c0,-1.55 0.815,-2.972 2.159,-3.742l9.065,-5.252a4.251,4.251 0 0 1 2.159,-0.576c0.74,0 1.5,0.185 2.158,0.576l9.066,5.252a4.296,4.296 0 0 1 2.159,3.742l0,25.973c0,1.546 0.89,2.95 2.23,3.742l21.297,12.232a2.096,2.096 0 0 0 2.159,0a2.164,2.164 0 0 0 1.08,-1.871l0.07,-55.618a4.28,4.28 0 0 0 -2.158,-3.741l-35.903,-20.722c-0.607,-0.356 -1.253,-0.475 -1.942,-0.503l-0.432,0zm322.624,0.503c-0.75,0 -1.485,0.19 -2.158,0.576l-35.903,20.722a4.306,4.306 0 0 0 -2.159,3.741l0,41.443c0,1.559 0.878,2.971 2.23,3.742l35.616,20.29c1.315,0.75 2.921,0.807 4.245,0.07l21.585,-12.015c0.685,-0.38 1.148,-1.09 1.151,-1.87a2.126,2.126 0 0 0 -1.079,-1.871l-36.119,-20.722c-0.676,-0.386 -1.151,-1.167 -1.151,-1.943l0,-12.95c0,-0.775 0.48,-1.485 1.151,-1.871l11.224,-6.476a2.155,2.155 0 0 1 2.159,0l11.223,6.476a2.152,2.152 0 0 1 1.08,1.87l0,10.217a2.15,2.15 0 0 0 1.079,1.87c0.673,0.389 1.487,0.39 2.158,0l21.514,-12.517a4.325,4.325 0 0 0 2.159,-3.742l0,-10c0,-1.545 -0.82,-2.966 -2.159,-3.742l-35.687,-20.722a4.279,4.279 0 0 0 -2.159,-0.575l0,-0.001zm-107.35,30.939c0.188,0 0.408,0.046 0.576,0.143l12.304,7.123c0.334,0.193 0.576,0.55 0.576,0.935l0,14.246c0,0.387 -0.24,0.743 -0.576,0.936l-12.304,7.123a1.088,1.088 0 0 1 -1.079,0l-12.303,-7.123c-0.335,-0.194 -0.576,-0.549 -0.576,-0.936l0,-14.246c0,-0.386 0.242,-0.74 0.576,-0.935l12.303,-7.122a0.948,0.948 0 0 1 0.504,-0.143l0,-0.001l-0.001,0z" fill="#fff" id="svg_4"/>
9
- <path d="m148.714,52.402c-0.748,0 -1.488,0.19 -2.158,0.576l-35.903,20.65c-1.343,0.773 -2.159,2.265 -2.159,3.813l0,41.443c0,1.55 0.817,2.966 2.159,3.742l35.903,20.721a4.297,4.297 0 0 0 4.317,0l35.903,-20.721a4.308,4.308 0 0 0 2.158,-3.742l0,-41.443c0,-1.55 -0.816,-3.04 -2.158,-3.813l-35.903,-20.65a4.297,4.297 0 0 0 -2.159,-0.576zm214.699,36.983c-0.143,0 -0.302,0 -0.431,0.072l-6.907,4.029a0.84,0.84 0 0 0 -0.432,0.72l0,7.914c0,0.298 0.172,0.571 0.432,0.72l6.907,3.957c0.259,0.15 0.535,0.15 0.791,0l6.907,-3.958a0.846,0.846 0 0 0 0.432,-0.719l0,-7.915a0.846,0.846 0 0 0 -0.432,-0.719l-6.907,-4.03c-0.128,-0.075 -0.216,-0.07 -0.36,-0.07l0,-0.001z" fill="#83CD29" id="svg_5"/>
10
- <path d="m3.332,260.629l0,-56.981l71.144,0l0,-3.333l-71.144,0l0,-51.983l75.642,0l0,-3.332l-78.974,0l0,118.961l79.64,0l0,-3.332l-76.307,0l-0.001,0zm140.455,-82.307l-29.49,38.821l-28.825,-38.82l-4.332,0l31.157,41.32l-34.157,44.317l3.999,0l32.156,-41.82l32.323,41.82l4.165,0l-34.322,-44.319l31.323,-41.32l-3.998,0l0.001,0.001zm16.994,114.963l0,-53.315l0.333,0c2,7.775 5.943,14.023 11.83,18.744c5.887,4.72 13.384,7.081 22.492,7.081c5.887,0 11.108,-1.194 15.662,-3.582s8.358,-5.637 11.413,-9.747c3.054,-4.11 5.387,-8.886 6.998,-14.329c1.61,-5.442 2.416,-11.163 2.416,-17.16c0,-6.443 -0.834,-12.386 -2.5,-17.828c-1.666,-5.443 -4.082,-10.164 -7.247,-14.162c-3.166,-3.999 -6.998,-7.11 -11.497,-9.33c-4.498,-2.222 -9.58,-3.333 -15.245,-3.333c-4.332,0 -8.358,0.639 -12.079,1.916c-3.721,1.278 -7.025,3.082 -9.913,5.415a36.674,36.674 0 0 0 -7.498,8.247c-2.11,3.166 -3.721,6.637 -4.832,10.414l-0.333,0l0,-23.994l-3.332,0l0,114.963l3.332,0zm34.655,-30.657c-10.44,0 -18.827,-3.582 -25.158,-10.746c-6.331,-7.164 -9.497,-17.467 -9.497,-30.907c0,-5.554 0.778,-10.83 2.333,-15.828c1.555,-4.998 3.804,-9.386 6.747,-13.162c2.944,-3.777 6.582,-6.776 10.913,-8.997c4.332,-2.222 9.22,-3.333 14.662,-3.333c5.554,0 10.414,1.111 14.579,3.333c4.165,2.221 7.609,5.248 10.33,9.08s4.776,8.22 6.165,13.162c1.388,4.943 2.082,10.191 2.082,15.745c0,4.999 -0.638,9.97 -1.916,14.912c-1.277,4.943 -3.249,9.386 -5.915,13.33c-2.665,3.942 -6.08,7.163 -10.246,9.663c-4.166,2.499 -9.192,3.748 -15.079,3.748zm54.816,1.333l0,-48.484c0,-4.665 0.666,-9.22 2,-13.662c1.332,-4.443 3.387,-8.359 6.164,-11.746c2.777,-3.388 6.303,-6.054 10.58,-7.998c4.276,-1.944 9.358,-2.749 15.245,-2.416l0,-3.332c-5.11,-0.11 -9.58,0.444 -13.412,1.666c-3.833,1.222 -7.137,2.888 -9.914,4.999c-2.777,2.11 -4.998,4.581 -6.664,7.414a33.15,33.15 0 0 0 -3.666,9.08l-0.333,0l0,-21.16l-3.332,0l0,85.64l3.332,0l0,-0.001zm38.154,-42.153l71.643,0c0.223,-5.887 -0.36,-11.551 -1.749,-16.994c-1.388,-5.443 -3.61,-10.275 -6.664,-14.495c-3.055,-4.221 -6.998,-7.609 -11.83,-10.164c-4.832,-2.555 -10.58,-3.832 -17.244,-3.832c-4.777,0 -9.442,1 -13.996,3c-4.554,1.999 -8.553,4.914 -11.996,8.746c-3.443,3.832 -6.22,8.525 -8.33,14.08c-2.11,5.553 -3.166,11.884 -3.166,18.993c0,6.331 0.722,12.246 2.166,17.744c1.444,5.498 3.665,10.275 6.664,14.329c3,4.054 6.86,7.192 11.58,9.413c4.72,2.222 10.413,3.277 17.078,3.166c9.774,0 17.994,-2.75 24.658,-8.247c6.665,-5.499 10.608,-13.246 11.83,-23.243l-3.332,0c-1.444,9.442 -5.138,16.523 -11.08,21.243c-5.943,4.721 -13.412,7.081 -22.41,7.081c-6.109,0 -11.274,-1.055 -15.495,-3.165c-4.22,-2.11 -7.664,-4.999 -10.33,-8.664c-2.665,-3.666 -4.637,-7.97 -5.914,-12.913c-1.278,-4.942 -1.972,-10.302 -2.083,-16.078zm68.311,-3.332l-68.31,0c0.332,-5.998 1.443,-11.385 3.331,-16.161c1.889,-4.777 4.36,-8.859 7.415,-12.246c3.054,-3.388 6.609,-5.97 10.663,-7.748c4.054,-1.777 8.414,-2.666 13.079,-2.666c5.554,0 10.44,1.028 14.662,3.083c4.22,2.055 7.747,4.86 10.58,8.414c2.832,3.554 4.97,7.692 6.414,12.412c1.444,4.721 2.166,9.692 2.166,14.912zm72.477,-14.828l3.332,0c0,-9.553 -2.777,-16.495 -8.33,-20.827c-5.555,-4.332 -13.108,-6.498 -22.66,-6.498c-5.332,0 -9.83,0.667 -13.496,2c-3.665,1.332 -6.664,3.054 -8.997,5.164c-2.332,2.11 -3.998,4.443 -4.998,6.998c-1,2.555 -1.5,4.999 -1.5,7.331c0,4.665 0.833,8.386 2.5,11.163c1.666,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.331,3c3.11,0.888 6.72,1.832 10.83,2.831c3.665,0.89 7.275,1.778 10.83,2.666c3.554,0.889 6.692,2.083 9.413,3.582c2.722,1.5 4.943,3.416 6.665,5.749c1.721,2.332 2.582,5.387 2.582,9.163c0,3.666 -0.86,6.776 -2.582,9.33a20.815,20.815 0 0 1 -6.581,6.249c-2.666,1.61 -5.638,2.776 -8.914,3.498c-3.277,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.856,-2.249 -23.243,-6.747c-5.387,-4.499 -8.08,-11.58 -8.08,-21.244l-3.333,0c0,10.775 2.916,18.661 8.747,23.66c5.832,4.998 14.468,7.497 25.909,7.497c3.665,0 7.358,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.996,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.75,-6.665 2.75,-10.997c0,-4.11 -0.806,-7.442 -2.416,-9.997c-1.611,-2.554 -3.721,-4.665 -6.332,-6.331c-2.61,-1.666 -5.553,-2.971 -8.83,-3.915a516.08,516.08 0 0 0 -9.914,-2.75a1726.675,1726.675 0 0 0 -12.246,-3.165c-3.498,-0.889 -6.747,-1.944 -9.746,-3.166c-2.888,-1.222 -5.193,-2.971 -6.915,-5.248c-1.722,-2.277 -2.582,-5.526 -2.582,-9.747c0,-0.777 0.222,-2.166 0.666,-4.165c0.444,-2 1.5,-4.027 3.166,-6.082c1.666,-2.054 4.22,-3.887 7.664,-5.498c3.443,-1.61 8.164,-2.416 14.162,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.304,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997zm77.141,0l3.332,0c0,-9.553 -2.776,-16.495 -8.33,-20.827c-5.554,-4.332 -13.107,-6.498 -22.66,-6.498c-5.331,0 -9.83,0.667 -13.495,2c-3.666,1.332 -6.665,3.054 -8.997,5.164c-2.333,2.11 -3.999,4.443 -4.999,6.998c-1,2.555 -1.499,4.999 -1.499,7.331c0,4.665 0.833,8.386 2.5,11.163c1.665,2.777 4.276,4.943 7.83,6.498c2.444,1.11 5.22,2.11 8.33,3c3.11,0.888 6.72,1.832 10.83,2.831c3.666,0.89 7.276,1.778 10.83,2.666c3.555,0.889 6.692,2.083 9.414,3.582c2.721,1.5 4.943,3.416 6.664,5.749c1.722,2.332 2.583,5.387 2.583,9.163c0,3.666 -0.861,6.776 -2.583,9.33a20.815,20.815 0 0 1 -6.58,6.249c-2.667,1.61 -5.638,2.776 -8.915,3.498c-3.276,0.722 -6.47,1.083 -9.58,1.083c-10.108,0 -17.855,-2.249 -23.242,-6.747c-5.388,-4.499 -8.081,-11.58 -8.081,-21.244l-3.332,0c0,10.775 2.915,18.661 8.747,23.66c5.831,4.998 14.467,7.497 25.908,7.497c3.666,0 7.359,-0.417 11.08,-1.25c3.72,-0.833 7.053,-2.193 9.997,-4.082a22.592,22.592 0 0 0 7.164,-7.33c1.833,-3 2.749,-6.665 2.749,-10.997c0,-4.11 -0.805,-7.442 -2.416,-9.997c-1.61,-2.554 -3.72,-4.665 -6.331,-6.331c-2.61,-1.666 -5.554,-2.971 -8.83,-3.915a516.071,516.071 0 0 0 -9.914,-2.75a1726.65,1726.65 0 0 0 -12.246,-3.165c-3.499,-0.889 -6.748,-1.944 -9.747,-3.166c-2.888,-1.222 -5.193,-2.971 -6.914,-5.248c-1.722,-2.277 -2.583,-5.526 -2.583,-9.747c0,-0.777 0.222,-2.166 0.667,-4.165c0.444,-2 1.5,-4.027 3.165,-6.082c1.666,-2.054 4.221,-3.887 7.664,-5.498c3.444,-1.61 8.164,-2.416 14.163,-2.416c4.11,0 7.858,0.445 11.246,1.333c3.388,0.889 6.303,2.305 8.747,4.249c2.444,1.944 4.332,4.415 5.665,7.414c1.333,3 2,6.665 2,10.997l-0.001,0z" fill="#fff" id="svg_6"/>
11
- </g>
12
- </svg>
@@ -1 +0,0 @@
1
- // Main processing.
@@ -1,3 +0,0 @@
1
- /*Home page script*/
2
-
3
- // Main processing.