|
| 1 | +@import com.statusneo.vms.model.Employee |
| 2 | +@import java.util.List |
| 3 | +@param List<Employee> employees |
| 4 | + |
| 5 | +<!DOCTYPE html> |
| 6 | +<html lang="en"> |
| 7 | +<head> |
| 8 | + <meta charset="UTF-8"> |
| 9 | + <title>Visitor Registration</title> |
| 10 | + <script src="https://cdn.tailwindcss.com"></script> |
| 11 | + <script src="https://unpkg.com/htmx.org@1.9.10"></script> |
| 12 | +</head> |
| 13 | +<body class="bg-gray-100 flex items-center justify-center min-h-screen"> |
| 14 | +<div class="bg-white p-8 rounded-lg shadow-md w-full max-w-lg"> |
| 15 | + <h2 class="text-2xl font-bold mb-6 text-center">Visitor Registration</h2> |
| 16 | + |
| 17 | + <!-- Registration Form --> |
| 18 | + <form id="visitorForm" |
| 19 | + hx-post="/api/visitors/register" |
| 20 | + hx-target="#formResponse" |
| 21 | + hx-swap="innerHTML" |
| 22 | + class="space-y-4"> |
| 23 | + |
| 24 | + <div> |
| 25 | + <label class="block text-gray-700">Full Name</label> |
| 26 | + <input type="text" name="name" required |
| 27 | + class="w-full border border-gray-300 p-2 rounded"/> |
| 28 | + </div> |
| 29 | + |
| 30 | + <div> |
| 31 | + <label class="block text-gray-700">Email</label> |
| 32 | + <input type="email" name="email" required |
| 33 | + class="w-full border border-gray-300 p-2 rounded"/> |
| 34 | + </div> |
| 35 | + |
| 36 | + <div> |
| 37 | + <label class="block text-gray-700">Phone Number</label> |
| 38 | + <input type="text" name="phoneNumber" pattern="\d{10}" required |
| 39 | + class="w-full border border-gray-300 p-2 rounded"/> |
| 40 | + </div> |
| 41 | + |
| 42 | + <div> |
| 43 | + <label class="block text-gray-700">Address</label> |
| 44 | + <textarea name="address" rows="2" required |
| 45 | + class="w-full border border-gray-300 p-2 rounded"></textarea> |
| 46 | + </div> |
| 47 | + |
| 48 | + <div> |
| 49 | + <label class="block text-gray-700">Host (Employee)</label> |
| 50 | + <select name="hostId" required |
| 51 | + class="w-full border border-gray-300 p-2 rounded"> |
| 52 | + <option value="">Select Host</option> |
| 53 | + @for(Employee employee : employees) |
| 54 | + <option value="${employee.getId()}">${employee.getName()} (${employee.getEmail()})</option> |
| 55 | + @endfor |
| 56 | + </select> |
| 57 | + </div> |
| 58 | + |
| 59 | + <button type="submit" |
| 60 | + class="w-full bg-blue-600 text-white p-2 rounded hover:bg-blue-700"> |
| 61 | + Register Visitor |
| 62 | + </button> |
| 63 | + </form> |
| 64 | + |
| 65 | + <div id="formResponse" class="mt-6"></div> |
| 66 | +</div> |
| 67 | +</body> |
| 68 | +</html> |
0 commit comments