<div class="modal center" ng-controller="PaperTaskAddCtrl">
<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" aria-label="Close" ng-click="$hide()">
				<span aria-hidden="true">×</span>
			</button>
			<h4 class="modal-title">添加命卷任务</h4>
		</div>
		
		<div class="modal-body">
			<div>
				<span>已选中课程：{{paperTaskModel.course.code}} - {{paperTaskModel.course.name}}</span>
				<span ng-if="paperTaskModel.teacher1.loginName"> / 命题教师1：{{paperTaskModel.teacher1.name}}</span>
				<span ng-if="paperTaskModel.teacher2.loginName"> / 命题教师2：{{paperTaskModel.teacher2.name}}</span>
				<span ng-if="paperTaskModel.secretary1.loginName"> / 学科秘书：{{paperTaskModel.secretary1.name}}</span>
				<!--<span ng-if="paperTaskModel.secretary2.loginName"> / 学科秘书2：{{paperTaskModel.secretary2.name}}</span>-->
				<span ng-if="paperTaskModel.inputer.loginName"> / 排版员：{{paperTaskModel.inputer.name}}</span>
			</div>
			<div class="m-t">
				<button type="button" ng-click="!paperTaskModel.paperTaskId ? goStep(1) : ''" class="btn btn-sm {{paperTaskModel.operStep == 1 ? 'btn-success' : 'btn-default'}} ">1.选择课程</button>
				<button type="button" ng-click="goStep(2)" class="btn btn-sm {{paperTaskModel.operStep == 2 ? 'btn-success' : 'btn-default'}} ">2.命题教师1</button>
				<button type="button" ng-click="goStep(3)" class="btn btn-sm {{paperTaskModel.operStep == 3 ? 'btn-success' : 'btn-default'}} ">3.命题教师2</button>
				<button type="button" ng-click="goStep(4)" class="btn btn-sm {{paperTaskModel.operStep == 4 ? 'btn-success' : 'btn-default'}} ">4.学科秘书</button>
				<!--<button type="button" ng-click="goStep(5)" class="btn btn-sm {{paperTaskModel.operStep == 5 ? 'btn-success' : 'btn-default'}} ">5.学科秘书2</button>-->
				<button type="button" ng-click="goStep(5)" class="btn btn-sm {{paperTaskModel.operStep == 5 ? 'btn-success' : 'btn-default'}} ">5.排版员</button>
			</div>
			<div ng-show="paperTaskModel.operStep==1">
				<div class="form-inline m-t">
					<div class="input-group">
			      		<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 table-bordered">
				  	<tr>
				  		<th class="col-sm-2">课程代码</th>
				  		<th class="col-sm-8">课程名称</th>
				  		<th>操作</th>
				 	</tr>
				 	<tr ng-repeat="row in pageModel.array">
				 		<td>{{row.code}}</td>
				 		<td>{{row.name}}</td>
						<td>
							<button ng-click="selectCourse(row)" class="btn btn-primary btn-xs" 
								ng-if="!row.inBatch">
								<i class="glyphicon glyphicon-plus"> 选择</i>								
							</button>
						</td>
				 	</tr>
				</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"> 上一页</span></a>
				      	</li>
					    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
					      	<a aria-label="Next"><span aria-hidden="true"> 下一页</span></a>
					    </li>
				    </ul>
			   	</nav>
			</div>
			
			<div ng-show="paperTaskModel.operStep > 1">
				<div class="form-inline m-t">
					<div class="input-group">
			      		<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 table-bordered">
				  	<tr>
				  		<th class="col-sm-5">姓名</th>
				  		<th class="col-sm-5">登录名</th>
				  		<th>操作</th>
				 	</tr>
				 	<tr ng-repeat="row in pageModel.array">
				 		<td>{{row.name}}</td>
				 		<td>{{row.loginName}}</td>
						<td>
							<button ng-click="selectUser(row)" class="btn btn-primary btn-xs">
								<i class="glyphicon glyphicon-plus"> 选择</i>								
							</button>
						</td>
				 	</tr>
			  	</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"> 上一页</span></a>
				      	</li>
					    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
					      	<a aria-label="Next"><span aria-hidden="true"> 下一页</span></a>
					    </li>
				    </ul>
			   	</nav>
			</div>
	    </div>
	    
	    	<div class="modal-footer">
	    		<button type="submit" ng-disabled="markForm.$invalid" ng-click="savePaperTask()" class="btn btn-info" >保存</button>
				<button type="submit" ng-click="$hide()" class="btn btn-default" >关闭</button>
			</div>
    
		</div>
	</div>
</div>
