<div ng-controller="QuestionTypeListCtrl" class="wrapper">
	<div class="panel panel-default">
		<div class="panel-body">
		  <div class="form-inline">
			<button ui-sref="questionType.add" class="btn btn-default">
				<i class="glyphicon glyphicon-plus"> 添加题型</i>
			</button>
			<button ui-sref="questionType.import" class="btn btn-default">
					<i class="glyphicon glyphicon-import"> 导入题型</i>
				</button>
				<div class="input-group col-sm-3">
		      		<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
					<input type="text" class="form-control" ng-model="search.keyword" placeholder="题型编码或题型名称" ng-change="goPage(1)" />
				</div>
		  </div>
			<table class="table table-striped">
				<thead>
					<tr>
						<th nowrap="nowrap" class="col-md-1">DB</th>
						<th nowrap="nowrap" class="col-md-1">题型编码</th>
						<th nowrap="nowrap" class="col-md-2">题型名称</th>
						<th nowrap="nowrap" class="col-md-1">类型</th>
						<th nowrap="nowrap" class="col-md-1">默认分值</th>
						<th nowrap="nowrap" class="col-md-1">状态</th>
						<th nowrap="nowrap" class="col-md-3">题型说明</th>
						<th nowrap="nowrap" class="col-md-2">操作</th>
					</tr>										
				</thead>
				<tbody>
					<tr ng-repeat="row in pageModel.array">
						<td>{{row.id}}</td>
						<td>{{row.code}}</td>
						<td>{{row.name}}</td>
						<td>{{row.type}}</td>
						<td>{{row.defaultScore}}</td>
						<td class="{{row.statusCode == 1 ? 'text-success' : 'text-danger'}}">{{row.statusCode | userStatus}}</td>
						<td>{{row.remark}}</td>
						<td>
							<button ng-click="edit(row.id)" class="btn btn-default btn-xs">
								<i class="glyphicon glyphicon-edit"> 编辑</i>								
							</button>
							<button ng-click="deleteQuestionType(row.id)" class="btn btn-danger btn-xs">
								<i class="glyphicon glyphicon-trash"> 删除</i>								
							</button>
						</td>
					</tr>
				</tbody>

			</table>
			<nav ng-if="pageModel.totalPage > 1">
				<ul class="pagination">
					<li class="{{pageModel.curPage == 1 ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage - 1)">
						<a aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
			      	</li>
				    <li ng-repeat="i in [9,8,7,6,5,4,3,2,1]" ng-if="pageModel.curPage - i > 0" ng-click="goPage(pageModel.curPage - i)">
				    	<a>{{pageModel.curPage - i}}</a>
			    	</li>
				    <li class="active"><a href="#">{{pageModel.curPage}}</a></li>
				    <li ng-repeat="i in [1,2,3,4,5,6,7,8,9]" ng-if="pageModel.curPage + i <= pageModel.totalPage" ng-click="goPage(pageModel.curPage + i)">
				    	<a>{{pageModel.curPage + i}}</a>
			    	</li>
				    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
				      	<a aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
				    </li>
				</ul>
			</div>
			
		</div>
	</div>
</div>