Browse Source

Place Text form changed to new standard

Andrew Grant 5 months ago
parent
commit
5b37ac2888

+ 32 - 22
src/main/resources/templates/text/personText/form.html

@@ -22,32 +22,42 @@
 <div th:insert="~{fragments/layout::banner}"></div>
 
 <div class="container border border-info rounded-3 text-center p-4">
+    <h3>Personal Text Details</h3>
     <form th:object="${personTextCommand}" th:action="@{/personText}" 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>
-        <div class="col-xs-4" style="margin-right:20px;">
-            <label for="person">Person</label>
-            <div>
-                <select id="person" style="width: 300px;" name="person" th:field="*{person}">
-                    <option th:value="${''}" th:text="${''}"></option>
-                    <option th:each="person : ${people}"
-                            th:value="${person.id}" th:text="${person.toString()}"></option>
-                </select>
-                <div th:if="${#fields.hasErrors('person')}">
-                    <ul class="text-danger">
-                        <li th:each="err : ${#fields.errors('person')}" th:text="${err}"/>
-                    </ul>
-                </div>
-            </div>
-        </div>
+        <table style="width:100%;">
+            <tr>
+                <td style="text-align: right;">
+                    <label for="id"><span style="color: rgb(255,0,0);">*</span>Database Id :&nbsp;</label>
+                </td>
+                <td style="text-align: left;">
+                    <input class="form-control" id="id"
+                           th:field="*{id}" type="text" readonly>
+                </td>
+            </tr>
+            <tr>
+                <td style="text-align: right;">
+                    <label for="person">Person :&nbsp;</label>
+                </td>
+                <td style="text-align: left;">
+                    <select id="person" style="width: 300px;" name="person :&nbsp;" th:field="*{person}">
+                        <option th:value="${''}" th:text="${''}"></option>
+                        <option th:each="person : ${people}"
+                                th:value="${person.id}" th:text="${person.toString()}"></option>
+                    </select>
+                    <div th:if="${#fields.hasErrors('person')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('person')}" th:text="${err}"/>
+                        </ul>
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td>&nbsp;</td>
+            </tr>
+        </table>
         <button type="submit" class="btn btn-primary">Commit</button>
         <a class="btn btn-secondary" th:href="@{/personTexts}" th:text="${'List all'}">List all</a>
         <a class="btn btn-success" th:href="@{/}" th:text="${'Home'}">Home</a>

+ 32 - 23
src/main/resources/templates/text/placeText/form.html

@@ -23,33 +23,42 @@
 <div th:insert="~{fragments/layout::banner}"></div>
 
 <div class="container border border-info rounded-3 text-center p-4">
+    <h3>Place Text Details</h3>
     <form th:object="${placeTextCommand}" th:action="@{/placeText}" 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>
-
-        <div class="col-xs-4" style="margin-right:20px;">
-            <label for="place">Place</label>
-            <div>
-                <select id="place" style="width: 300px;" name="place" th:field="*{place}">
-                    <option th:value="${''}" th:text="${''}"></option>
-                    <option th:each="place : ${places}"
-                            th:value="${place.id}" th:text="${place.toString()}"></option>
-                </select>
-                <div th:if="${#fields.hasErrors('place')}">
-                    <ul class="text-danger">
-                        <li th:each="err : ${#fields.errors('place')}" th:text="${err}"/>
-                    </ul>
-                </div>
-            </div>
-        </div>
+        <table style="width:100%;">
+            <tr>
+                <td style="text-align: right;">
+                    <label for="id"><span style="color: rgb(255,0,0);">*</span>Database Id :&nbsp;</label>
+                </td>
+                <td style="text-align: left;">
+                    <input class="form-control" id="id"
+                           th:field="*{id}" type="text" readonly>
+                </td>
+            </tr>
+            <tr>
+                <td style="text-align: right;">
+                    <label for="place">Place :&nbsp;</label>
+                </td>
+                <td style="text-align: left;">
+                    <select id="place" style="width: 300px;" name="place" th:field="*{place}">
+                        <option th:value="${''}" th:text="${''}"></option>
+                        <option th:each="place : ${places}"
+                                th:value="${place.id}" th:text="${place.toString()}"></option>
+                    </select>
+                    <div th:if="${#fields.hasErrors('place')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('place')}" th:text="${err}"/>
+                        </ul>
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td>&nbsp;</td>
+            </tr>
+        </table>
 
         <button type="submit" class="btn btn-primary">Commit</button>
         <a class="btn btn-secondary" th:href="@{/placeTexts}" th:text="${'List all'}">List all</a>

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

@@ -41,7 +41,7 @@
                            th:href="'placeTexts/' + ${text.id} + '/delete'"
                            th:text="Delete"></a>
                     <a th:action="edit" class="btn btn-warning btn-sm"
-                       th:href="'placedText/' + ${text.id} + '/edit'"
+                       th:href="'placeText/' + ${text.id} + '/edit'"
                        th:text="Edit"></a>
                     </span></td>
             </tr>