Explorar el Código

Region form - fixed

Andrew Grant hace 5 meses
padre
commit
c23cd9d417

+ 6 - 6
src/main/resources/templates/country/form.html

@@ -30,19 +30,19 @@ rounded-3 text-center p-4">
         </div>
         <table style = "width:100%;">
             <tr>
-                <td>
-                    <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span></label>
+                <td style="text-align: right;">
+                    <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span>&nbsp;</label>
                 </td>
-                <td>
+                <td style="text-align: left;">
                     <input class="form-control" id="id"
                            th:field="*{id}" type="text" readonly>
                 </td>
             </tr>
             <tr>
-                <td>
-                    <label for="name">Name</label>
+                <td style="text-align: right;">
+                    <label for="name">Name&nbsp;</label>
                 </td>
-                <td>
+                <td style="text-align: left;">
                     <input class="form-control" id="name"
                            th:field="*{name}" type="text">
                     <div th:if="${#fields.hasErrors('name')}">

+ 37 - 25
src/main/resources/templates/region/form.html

@@ -25,30 +25,41 @@
 
 <div class="container border border-info
 rounded-3 text-center p-4">
+    <h3>Region Details</h3>
     <form th:object="${regionCommand}" th:action="@{/region}" 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-4">
-                <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span></label>
+        <table  style = "width:100%;">
+        <tr>
+            <td style="text-align: right;">
+                <label for="id">Database Id<span style="color: rgb(255,0,0);">*</span>&nbsp;</label>
+            </td>
+            <td>
                 <input class="form-control" id="id"
                        th:field="*{id}" type="text" style="margin-right:50px;" readonly>
-            </div>
-            <div class="col-xs-4" style="margin-right:20px;">
-                <label for="name">Name</label>
-                <input class="form-control" id="name"
-                       th:field="*{name}" type="text">
-                <div th:if="${#fields.hasErrors('name')}">
-                    <ul class="text-danger">
-                        <li th:each="err : ${#fields.errors('name')}" th:text="${err}"/>
-                    </ul>
-                </div>
-            </div>
-            <div class="col-xs-4" style="margin-right:20px;">
-                <label for="country">Country</label>
-                <div>
-                    <select id="country" style="width: 300px;" name="country" th:field="*{country}">
+            </td>
+        </tr>
+            <tr>
+                <td style="text-align: right;">
+                    <label for="name">Name&nbsp;</label>
+                </td>
+                <td>
+                    <input class="form-control" id="name"
+                           th:field="*{name}" type="text">
+                    <div th:if="${#fields.hasErrors('name')}">
+                        <ul class="text-danger">
+                            <li th:each="err : ${#fields.errors('name')}" th:text="${err}"/>
+                        </ul>
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td style="text-align: right;">
+                    <label for="country">Country&nbsp;</label>
+                </td>
+                <td style="text-align: left;">
+                    <select id="country" name="country" th:field="*{country}" >
                         <option th:value="${''}" th:text="${''}"></option>
                         <option th:each="country : ${countries}"
                                 th:value="${country.id}" th:text="${country.name}"></option>
@@ -58,13 +69,14 @@ rounded-3 text-center p-4">
                             <li th:each="err : ${#fields.errors('country')}" th:text="${err}"/>
                         </ul>
                     </div>
-                </div>
-            </div>
-        </div>
-        <button type="submit" class="btn btn-primary">Commit</button>
-        <a class="btn btn-secondary" th:href="@{/regions}" 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>
+                </td>
+            </tr>
+            <tr><td>&nbsp;</td></tr>
+        </table>
+                <button type="submit" class="btn btn-primary">Commit</button>
+                <a class="btn btn-secondary" th:href="@{/regions}" 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>