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

@*******************************************
* Helper generating navigation links *
*******************************************@
@link(newPage: Int) = @{
	routes.DesignChangeController.list(newPage, key)
}
@main("Design Change List Master by Play 2.1") {
	<h3>@Messages("title21")@Messages("title15")</h3>

    <a href="/designChangeCoverForm">@Messages("title21")@Messages("list.link18")</a>
    &nbsp
    <a href="/">@Messages("link.title1")</a>
	<br />
	<br />
	<div id="action">
		@helper.form(action=routes.DesignChangeController.list(page, key)) {
			<input type="search" id="searchbox" name="key" value="@key" placeholder="fill by the design change number">
			<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-striped">
			<thead>
				<tr>
					<th>@Messages("list.header4")</th>
					<th>@Messages("form.header12")</th>
					<th>@Messages("form.header13")</th>
				</tr>
			</thead>
			<tbody>
				@for(designChange <- designChanges) {
					<tr><td>@designChange.id</td>
					<td><a href="/designChangeCoverModify?id=@designChange.id">@designChange.dcNo</a></td>
					<td><a href="/designChangeCoverModify?id=@designChange.id">@designChange.dcDescription</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="/designChangeCoverForm">@Messages("title21")@Messages("list.link18")</a>
	    &nbsp
	    <a href="/">@Messages("link.title1")</a>
	    
}