@(users: Seq[models.User])(userForm: Form[models.User])(implicit messages: Messages)

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Manage Users</title>
        <meta charset="utf-8">
  		<meta name="viewport" content="width=device-width, initial-scale=1">
  		<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/main.css")">
        <link rel="stylesheet" media="screen" href="@routes.Assets.versioned("lib/bootstrap/css/bootstrap.min.css")">
        <link rel="stylesheet" media="screen" href="@routes.Assets.versioned("lib/bootstrap/css/bootstrap-theme.min.css")">
        <script src="@routes.Assets.versioned("lib/jquery/jquery.min.js")"  type="text/javascript"></script>
        <script src="@routes.Assets.versioned("lib/bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>
    </head>
    <body>
    	<div class="container">
    		<div class="panel">
    			@if(userForm.hasGlobalErrors) {
				  @for(error <- userForm.globalErrors) {
					  <div class="alert alert-danger" role="alert">
	  					<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
	  					@Messages(error.messages, error.args)
					  </div>  
				  }
				}
				@helper.form(action = routes.UserController.addUser) {
				    @helper.inputText(userForm("email"), '_label -> "Email Address")
				    @helper.inputText(userForm("firstName"), '_label -> "First Name")
				    @helper.inputText(userForm("lastName"), '_label -> "Last Name")
				    <button class="btn btn-default" type="submit">Add User</button>
				}			
			</div>
		    <div class="panel panel-default">
			 	<div class="panel-heading">Users</div>
			  	<table class="table">
			  		<thead>
						<tr>
							<th>Id</th>
							<th>First Name</th>
							<th>Last Name</th>
							<th>Email</th>
						</tr>
					</thead>
					@for(user <- users) {
			    		<tr>
			    			<td>@user.id</td>
							<td>@user.firstName</td>
							<td>@user.lastName</td>
							<td>@user.email</td>
			    		</tr>
			   		}
			  	</table>
			</div>
		</div>
    </body>
</html>
