@(users: org.squeryl.Query[User], maxColumn: Int, key: String, page: Int)(implicit lang: Lang)
@import models.User

@*******************************************
* Helper generating navigation links *
*******************************************@
@link(newPage: Int) = @{
	routes.UserController.list(newPage, key)
}

@main("User List by Play 2.1") {
	<h3>@Messages("title13")</h3>
	
	<dev id="action">
		@helper.form(action=routes.UserController.list(page, key)) {
			<input type="search" id="searchbox" name="key" value="@key" placeholder="fill by the user name">
			<input type="hidden" name="page" value="0">
			<input type="submit" id="search submit" value=@Messages("btn.label1") class="btn.primary">
		}
	</div>
	<table class="computers zebra-stripes">
		<thead>
			<tr>
				<th>@Messages("form.header4")</th>
				<th>@Messages("form.header5")</th>
			</tr>
		</thead>
		<tbody>
			@for(user <- users) {
				<tr><td><a href="/userModify?id=@user.id">@user.name</a></td>
				<td><a href="/userModify?id=@user.id">@user.email</a></td></tr>
			}
		</tbody>
	</table>
	<div id="pagination" class="pagination">
		<ul>
			@if(page-1 < 0) {
				<li class="prev disabled">&larr; prev</li>
			} else {
				<li class="prev"><a href="@link(page-1)">prev</a></li>
			}
			<li class="current">current page:@(page+1)</li>
			@if((page+1)*(Integer.decode(Messages("list.row"))) >= maxColumn) {
				<li class="next disabled">next &rarr;</li>
			} else {
				<li class="next"><a href="@link(page+1)">next</a></li>
			}
		</ul>
	</div>
	<br />
	<a href="/list?page=0&key=">@Messages("title6")</a>
	&nbsp
	<a href="/userCreate">@Messages("title10")</a>
}