From 8bb83317a73c5a9da25ff366c1c94ab71e8cb25a Mon Sep 17 00:00:00 2001
From: Eric van der Toorn <E.A.vanderToorn@student.tudelft.nl>
Date: Wed, 25 Mar 2020 15:24:47 +0100
Subject: [PATCH] add add and edit buttons to patient list

Signed-off-by: Eric van der Toorn <E.A.vanderToorn@student.tudelft.nl>
---
 src/main/resources/templates/admin/patient/view.html | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/templates/admin/patient/view.html b/src/main/resources/templates/admin/patient/view.html
index 392358c9..b9c07c43 100644
--- a/src/main/resources/templates/admin/patient/view.html
+++ b/src/main/resources/templates/admin/patient/view.html
@@ -12,17 +12,22 @@
                 <td>Name</td>
                 <td>Token</td>
                 <td>Area</td>
+                <td>Edit</td>
             </tr>
             </thead>
             <tbody>
-            <tr th:if="${patients.empty}">
+            <tr th:if="${patients?.empty}">
                 <td colspan="4">No patients</td>
             </tr>
             <tr th:each="patient : ${patients}">
                 <td th:text="${patient.patientId}">1</td>
-                <td><a href="edit.html" th:href="@{'/edit/' + ${patient.patientId}}" th:text="${patient.name}">Name .. </a></td>
+                <td th:text="${patient.name?.firstName}">Name .. </td>
                 <td th:text="${patient.token}">Token ...</td>
-                <td th:text="${patient.area}">Area...</td>
+                <td th:text="${patient.area?.name}">Area...</td>
+                <td><a class="btn btn-secondary fa fa-edit" th:href="@{'/patient/edit/' + ${patient.id}}"></a></td>
+            </tr>
+            <tr>
+                <td><a class="btn btn-secondary fa fa-plus" th:href="@{'/patient/add'}"></a> </td>
             </tr>
             </tbody>
         </table>
-- 
GitLab