aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources/templates/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/templates/pkgs')
-rw-r--r--src/main/resources/templates/pkgs/add.html109
-rw-r--r--src/main/resources/templates/pkgs/edit.html109
-rw-r--r--src/main/resources/templates/pkgs/index.html62
-rw-r--r--src/main/resources/templates/pkgs/sorting.html6
4 files changed, 286 insertions, 0 deletions
diff --git a/src/main/resources/templates/pkgs/add.html b/src/main/resources/templates/pkgs/add.html
new file mode 100644
index 0000000..107784f
--- /dev/null
+++ b/src/main/resources/templates/pkgs/add.html
@@ -0,0 +1,109 @@
+<!doctype html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org"
+ xmlns:sec="http://www.thymeleaf.org">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>builddb</title>
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
+</head>
+<body>
+
+<nav th:insert="~{/navbar :: navigation}"></nav>
+
+<hr>
+
+<div class="container">
+ <div class="col-md-8 mx-auto rounded border p-4 m-4">
+ <h2 class="text-center mb-5">Add Package</h2>
+
+ <form method="post" enctype="multipart/form-data" th:object="${pkgDto}">
+ <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Sequence</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.sequence}" />
+ <p th:if="${#fields.hasErrors('sequence')}" th:errorclass="text-danger" th:errors="${pkgDto.sequence}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Name</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.name}" />
+ <p th:if="${#fields.hasErrors('name')}" th:errorclass="text-danger" th:errors="${pkgDto.name}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Version</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.version}" />
+ <p th:if="${#fields.hasErrors('version')}" th:errorclass="text-danger" th:errors="${pkgDto.version}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Configure</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.configure}" />
+ <p th:if="${#fields.hasErrors('configure')}" th:errorclass="text-danger" th:errors="${pkgDto.configure}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Build</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.build}" />
+ <p th:if="${#fields.hasErrors('build')}" th:errorclass="text-danger" th:errors="${pkgDto.build}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Install</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.install}" />
+ <p th:if="${#fields.hasErrors('install')}" th:errorclass="text-danger" th:errors="${pkgDto.install}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Setup</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.setup}" />
+ <p th:if="${#fields.hasErrors('setup')}" th:errorclass="text-danger" th:errors="${pkgDto.setup}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Notes</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.notes}" />
+ <p th:if="${#fields.hasErrors('notes')}" th:errorclass="text-danger" th:errors="${pkgDto.notes}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Url</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.url}" />
+ <p th:if="${#fields.hasErrors('Url')}" th:errorclass="text-danger" th:errors="${pkgDto.url}"></p>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="offset-sm-4 col-sm-4 d-grid">
+ <button type="submit" class="btn btn-primary">Submit</button>
+ </div>
+ <div class="col-sm-4 d-grid">
+ <a class="btn btn-outline-primary" href="/pkgs" role="button">Cancel</a>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/src/main/resources/templates/pkgs/edit.html b/src/main/resources/templates/pkgs/edit.html
new file mode 100644
index 0000000..34ad9a8
--- /dev/null
+++ b/src/main/resources/templates/pkgs/edit.html
@@ -0,0 +1,109 @@
+<!doctype html>
+<html lang="en" xmlns:th="http://www.thymeleaf.org"
+ xmlns:sec="http://www.thymeleaf.org">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>builddb</title>
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
+</head>
+<body>
+
+<nav th:insert="~{/navbar :: navigation}"></nav>
+
+<hr>
+
+<div class="container">
+ <div class="col-md-8 mx-auto rounded border p-4 m-4">
+ <h2 class="text-center mb-5">Edit Package</h2>
+
+ <form method="post" enctype="multipart/form-data" th:object="${pkgDto}">
+ <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Sequence</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.sequence}" />
+ <p th:if="${#fields.hasErrors('sequence')}" th:errorclass="text-danger" th:errors="${pkgDto.sequence}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Name</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.name}" />
+ <p th:if="${#fields.hasErrors('name')}" th:errorclass="text-danger" th:errors="${pkgDto.name}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Version</label>
+ <div class="col-sm-8">
+ <input class="form-control" th:field="${pkgDto.version}" />
+ <p th:if="${#fields.hasErrors('version')}" th:errorclass="text-danger" th:errors="${pkgDto.version}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Configure</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.configure}" />
+ <p th:if="${#fields.hasErrors('configure')}" th:errorclass="text-danger" th:errors="${pkgDto.configure}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Build</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.build}" />
+ <p th:if="${#fields.hasErrors('build')}" th:errorclass="text-danger" th:errors="${pkgDto.build}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Install</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.install}" />
+ <p th:if="${#fields.hasErrors('install')}" th:errorclass="text-danger" th:errors="${pkgDto.install}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Setup</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.setup}" />
+ <p th:if="${#fields.hasErrors('setup')}" th:errorclass="text-danger" th:errors="${pkgDto.setup}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Notes</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.notes}" />
+ <p th:if="${#fields.hasErrors('notes')}" th:errorclass="text-danger" th:errors="${pkgDto.notes}"></p>
+ </div>
+ </div>
+
+ <div class="row mb-3">
+ <label class="col-sm-4 col-form-label">Url</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" th:field="${pkgDto.url}" />
+ <p th:if="${#fields.hasErrors('Url')}" th:errorclass="text-danger" th:errors="${pkgDto.url}"></p>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="offset-sm-4 col-sm-4 d-grid">
+ <button type="submit" class="btn btn-primary">Submit</button>
+ </div>
+ <div class="col-sm-4 d-grid">
+ <a class="btn btn-outline-primary" href="/pkgs/" role="button">Cancel</a>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/src/main/resources/templates/pkgs/index.html b/src/main/resources/templates/pkgs/index.html
new file mode 100644
index 0000000..04eb45a
--- /dev/null
+++ b/src/main/resources/templates/pkgs/index.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Builddb</title>
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
+</head>
+<body>
+<nav th:insert="~{/navbar :: navigation}"></nav>
+
+<hr>
+<hr>
+
+<div class="container">
+ <h1 class="text-center my-4">Packages</h1>
+ <a class="btn btn-primary fa fa-add" href="/pkgs/add"></a>
+
+ <hr>
+
+ <table class="table table-bordered table-hover table-striped">
+ <thead>
+ <tr>
+ <th id="0" th:replace="~{pkgs/sorting :: sorting('sequence', 'Seq')}">Seq</th>
+ <th th:replace="~{pkgs/sorting :: sorting('name', 'Name')}">Name</th>
+ <th>Version</th>
+ <th>Configure</th>
+ <th>Build</th>
+ <th>Install</th>
+ <th>Setup</th>
+ <th>Notes</th>
+ <th>Url</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody class="table-group-divider">
+ <tr th:each="pkg : ${pkgs}">
+ <td th:id="${pkg.id}" th:text="${pkg.sequence}"></td>
+ <td th:text="${pkg.name}"></td>
+ <td th:text="${pkg.version}"></td>
+ <td th:text="${pkg.configure}"></td>
+ <td th:text="${pkg.build}"></td>
+ <td th:text="${pkg.install}"></td>
+ <td th:text="${pkg.setup}"></td>
+ <td th:text="${pkg.notes}"></td>
+ <td th:text="${pkg.url}"></td>
+ <td style="white-space:nowrap">
+ <a class="btn btn-primary btn-sm fa fa-edit"
+ th:href="@{/pkgs/edit(id=${pkg.id})}"></a>
+ <a class="btn btn-danger btn-sm fa fa-trash"
+ th:href="@{/pkgs/delete(id=${pkg.id})}"
+ onclick="return confirm('Delete?')"></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/src/main/resources/templates/pkgs/sorting.html b/src/main/resources/templates/pkgs/sorting.html
new file mode 100644
index 0000000..199ef68
--- /dev/null
+++ b/src/main/resources/templates/pkgs/sorting.html
@@ -0,0 +1,6 @@
+<th scope="col" th:fragment="sorting(field, label)">
+ <a class="text-decoration-none text-dark"
+ th:href="@{'/pkgs?' + ${sortField!=null ? '&sort=' + field + ',' + (sortField == field ? reverseSortDirection : sortDirection) : ''}}">[[${label}]]</a>
+ <span th:if="${sortField == field}"
+ th:class="${sortDirection == 'asc' ? 'fas fa-arrow-down-short-wide' : 'fas fa-arrow-down-wide-short'}"></span>
+</th> \ No newline at end of file