ソースを参照

Person Texts List Controller (2)

Andrew Grant 6 ヶ月 前
コミット
3060e8b66d

+ 5 - 0
src/main/java/scot/carricksoftware/grants/constants/TextAttributeConstants.java

@@ -24,6 +24,11 @@ public class TextAttributeConstants {
     @SuppressWarnings({"unused"})
     public static final String PERSON_TEXT_COMMAND = "document_text_Command";
 
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXTS = "place_texts";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_COMMAND = "place_text_Command";
+
     @SuppressWarnings("unused")
     public static final String PERSON_IMAGES = "personImages";
     @SuppressWarnings({"unused"})

+ 21 - 1
src/main/java/scot/carricksoftware/grants/constants/TextMappingConstants.java

@@ -55,7 +55,27 @@ public class TextMappingConstants {
     public static final String PERSON_TEXT_DELETE = "/personTexts/{id}/delete";
     @SuppressWarnings({"unused"})
     public static final String PERSON_TEXT_EDIT = "personText/{id}/edit";
-  
+
+    public static final String PLACE_TEXT_LIST = "/placeTexts";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_NEXT = "/placeTexts/next";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_PREVIOUS = "/placeTexts/prev";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_REWIND = "/placeTexts/rewind";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_FF = "/placeTexts/ff";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_NEW = "/placeText/new";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT = "/placeText";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_SHOW = "/placeText/{id}/show";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_DELETE = "/placeTexts/{id}/delete";
+    @SuppressWarnings({"unused"})
+    public static final String PLACE_TEXT_EDIT = "placeText/{id}/edit";
+    
 }
 
 

+ 43 - 0
src/main/resources/templates/text/placeText/form.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<!--suppress XmlHighlighting -->
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <!-- Required meta tags -->
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+
+    <!-- Bootstrap CSS -->
+    <!--suppress SpellCheckingInspection -->
+    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
+          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
+
+    <!--suppress SpellCheckingInspection -->
+    <script src="https://code.jquery.com/jquery-3.6.0.min.js"
+            integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
+    <title>Grants - images</title>
+
+</head>
+<body>
+<!--/*@thymesVar id="personTextCommand" type="scot.carricksoftware.grants.commands.text.PersonTextCommand"*/-->
+<div th:insert="~{fragments/layout::banner}"></div>
+
+<div class="container border border-info rounded-3 text-center p-4">
+    <form th:object="${imageCommand}" th:action="@{/person}" method="post">
+        <div th:if="${#fields.hasErrors('*')}" class="alert alert-danger">
+            <p>Please Correct The Errors Below</p>
+        </div>
+        <div class="form-group row justify-content-center">
+            <div class="col-xs-2">
+                <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span></label>
+                <input class="form-control" id="id"
+                       th:field="*{id}" type="text" readonly>
+            </div>
+        </div>
+        <button type="submit" class="btn btn-primary">Commit</button>
+        <a class="btn btn-secondary" th:href="@{/people}" th:text="${'List all'}">List all</a>
+        <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>
+        <h6><span style="color: rgb(255,0,0);">*</span><span> Cannot be edited</span></h6>
+    </form>
+</div>
+</body>
+</html>

+ 69 - 0
src/main/resources/templates/text/placeText/list.html

@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+
+<!--
+  ~ Copyright (c) 2025 Andrew Grant of Carrick Software .
+  ~ All rights reserved.
+  -->
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>People </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>
+<div th:insert="~{fragments/layout::banner}"></div>
+
+
+<div class="container text-center">
+    <div class="container border border-info
+                    rounded-3 text-center p-4">
+        <h3>Person Texts</h3>
+        <table class="table table-striped table-bordered">
+            <thead class="table-dark">
+            <tr>
+                <th>ID</th>
+                <th></th>
+                <th></th>
+                <th></th>
+            </tr>
+            </thead>
+
+            <!--/*@thymesVar id="text" type="scot.carricksoftware.grants.domains.text.PersonText"*/-->
+            <tr th:each="text : ${document_texts}">
+                <td th:text="${text.id}">123</td>
+                <td></td>
+                <td></td>
+                <td><span>
+                        <a th:action="delete" class="btn btn-danger btn-sm" href=""
+                           th:href="'personTexts/' + ${text.id} + '/delete'"
+                           th:text="Delete"></a>
+                    <a th:action="edit" class="btn btn-warning btn-sm"
+                       th:href="'personText/' + ${text.id} + '/edit'"
+                       th:text="Edit"></a>
+                    </span></td>
+            </tr>
+            <tfoot>
+            <tr>
+                <td colspan="4"><span>
+                        <a th:action="rewind" class="btn btn-secondary btn-sm" th:href="@{/personTexts/rewind}"
+                           th:text="'<<'"></a>
+                         <a th:action="back" class="btn btn-secondary btn-sm"
+                            th:href="@{/personTexts/prev}" th:text="'<'"></a>
+                         <a th:action="new" class="btn btn-primary btn-sm" th:href="@{/personText/new}"
+                            th:text="'New Document'"></a>
+                         <a th:action="home" class="btn btn-success btn-sm"
+                            th:href="@{/}" th:text="'Home'"></a>
+                         <a th:action="forward" class="btn btn-secondary btn-sm"
+                            th:href="@{/personTexts/next}" th:text="'>'"></a>
+                         <a th:action="end" class="btn btn-secondary btn-sm" th:href="@{/personTexts/ff}"
+                            th:text="'>>'"></a>
+                        </span></td>
+            </tr>
+            </tfoot>
+        </table>
+    </div>
+</div>
+</body>
+</html>
+