@(projects: org.squeryl.Query[Project], maxColumn: Int, key: String, page:Int)(implicit lang: Lang)
@import models.Project
@*******************************************
* Helper generating navigation links *
*******************************************@
@link(newPage: Int) = @{
	routes.ProjectController.list(newPage, key)
}

@main("Project Lists by Play 2.1") {
	<h3>@Messages("title12")</h3>
	
	<div id="action">
		@helper.form(action=routes.ProjectController.list(page, key)) {
			<input type="search" id="searchbox" name="key" value="@key" placeholder="fill by the project 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("list.header6")</th>
				<th>@Messages("list.header7")</th>
			</tr>
		</thead>
		<tbody>
			@for(project <- projects) {
				<tr><td><a href="/projectModify?id=@project.id">@project.name</a></td>
				<td>@project.users.head.name</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</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="/projectCreate">@Messages("title8")</a>
    &nbsp
    <a href="/">@Messages("link.title1")</a>
	
}