Added CRUD for 'Mechanic' entity. Added translations.

This commit is contained in:
2019-05-05 14:50:00 +03:00
parent b541e69885
commit 0124899525
15 changed files with 453 additions and 23 deletions
@@ -10,28 +10,28 @@
<form th:action="'/client/' + ${client.id != null ? 'update/' + client.id : 'create'}" th:object="${client}" method="post">
<div class="form-group row">
<label for="clientFirstName" class="col-sm-2 col-form-label">First Name</label>
<label for="clientFirstName" class="col-sm-2 col-form-label" th:text="#{firstName.label}"></label>
<div class="col-sm-10">
<input type="text" name="firstName" class="form-control" id="clientFirstName" th:field="*{firstName}" th:errorclass="fieldError" th:value="${client.firstName}">
<div th:replace="common::errors('firstName')"></div>
</div>
</div>
<div class="form-group row">
<label for="clientMiddleName" class="col-sm-2 col-form-label">Middle Name</label>
<label for="clientMiddleName" class="col-sm-2 col-form-label" th:text="#{middleName.label}"></label>
<div class="col-sm-10">
<input type="text" name="middleName" class="form-control" id="clientMiddleName" th:field="*{middleName}" th:errorclass="fieldError" th:value="${client.middleName}">
<div th:replace="common::errors('middleName')"></div>
</div>
</div>
<div class="form-group row">
<label for="clientLastName" class="col-sm-2 col-form-label">Last Name</label>
<label for="clientLastName" class="col-sm-2 col-form-label" th:text="#{lastName.label}"></label>
<div class="col-sm-10">
<input type="text" name="lastName" class="form-control" id="clientLastName" th:field="*{lastName}" th:errorclass="fieldError" th:value="${client.lastName}">
<div th:replace="common::errors('lastName')"></div>
</div>
</div>
<div class="form-group row">
<label for="clientPhoneNo" class="col-sm-2 col-form-label">Phone No</label>
<label for="clientPhoneNo" class="col-sm-2 col-form-label" th:text="#{phoneNo.label}"></label>
<div class="col-sm-10">
<input type="text" name="phoneNo" class="form-control" id="clientPhoneNo" th:field="*{phoneNo}" th:errorclass="fieldError" th:value="${client.phoneNo}">
<div th:replace="common::errors('phoneNo')"></div>
@@ -39,8 +39,8 @@
</div>
<div class="form-group row pull-right">
<div class="col-sm-12">
<a href="/client" class="btn btn-default">Back</a>
<button type="submit" class="btn btn-primary">Save</button>
<a href="/client" class="btn btn-default" th:text="#{common.back.button}"></a>
<button type="submit" class="btn btn-primary" th:text="#{common.save.button}"></button>
</div>
</div>
</form>
@@ -26,16 +26,16 @@
<h1 th:text="#{client.title}"></h1>
<div class="pull-right">
<a class="btn btn-success" th:href="@{/client/create}">Create</a>
<a class="btn btn-success" th:href="@{/client/create}" th:text="#{common.create.button}"></a>
</div>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
<th>Phone No</th>
<th th:text="#{firstName.label}"></th>
<th th:text="#{middleName.label}"></th>
<th th:text="#{lastName.label}"></th>
<th th:text="#{phoneNo.label}"></th>
<th>&nbsp;</th>
</tr>
</thead>
@@ -47,8 +47,8 @@
<td th:text="${client.phoneNo}"></td>
<td>
<div class="btn-group pull-right">
<a th:href="@{/client/edit/{id}(id=${client.id})}" class="btn btn-default">Edit</a>
<button type="button" class="btn btn-danger" th:onclick="'deleteClientById(' + ${client.id} + ')'">Delete</button>
<a th:href="@{/client/edit/{id}(id=${client.id})}" class="btn btn-default" th:text="#{common.edit.button}"></a>
<button type="button" class="btn btn-danger" th:onclick="'deleteClientById(' + ${client.id} + ')'" th:text="#{common.delete.button}"></button>
</div>
</td>
</tr>