@(tasks: List[TableTask], tableForm: Form[TableTask]) @* This is the HTML/scala template that defines the Tables interface *@ @import helper._ @* Scala main function to start the template *@ @main("Restaurant Tables") { } {
Seats: @task.seats
Current Waiter: @task.currentWaiter
@* If table is not occupied, place a "Sit Here" button *@ @if(task.isOccupied == 0) { @form(routes.Tables.sitHere(task.id)) { } } @* If table becomes occupied, replace the "Sit Here" button with the "Customer Left" button *@ @if(task.isOccupied == 1) { @form(routes.Tables.customerLeft(task.id)) { } } @* If customer leaves table and table needs cleaning, replace the "Customer Left" button *@ @* with the "Finished Cleaning" button so the waiter can reopen after cleaning *@ @if(task.isOccupied == 2) { @form(routes.Tables.finishedCleaning(task.id)) { } } @* Delete a table *@ @form(routes.Tables.deleteTask(task.id)) { }