<div class="row" ng-controller="BatchInfoSupplyPaperCtrl">
<div cg-busy="{promise:loading,message:'正在加载...'}">

	<div class="col-md-3 sidebar">
		<div class="panel panel-default nav-sidebar" >
		<h4 class="padder">课程列表  </h4>
		<div  >
		<div class="list-group">
		  <a ng-click="selectCourse($index)" ng-focus="selectCourse($index)" focus-me="{{selected.id == item.id}}" ng-repeat="item in courses" tabindex="{{$index+1}}" ng-class="{'list-group-item':true,'active':selected.id == item.id}">
		  <span class="badge pull-left">{{$index+1}}</span>&nbsp;&nbsp;
		   {{item.courseCode}} {{item.courseName}}
		  <span ng-show="item.paperId" class="pull-right text-success" style="color:inherit;"><i class="glyphicon glyphicon-ok"></i></span>
		  </a>
		</div>
		</div>
	</div>
	</div>
	<div class="col-md-9 col-md-offset-3">
		<div ng-show="(courses | filter:{paperId:null}).length > 0" class="alert alert-warning text-md" style="padding-top:8px;padding-bottom:8px;" >
			还剩<span class="padder text-danger font-bold">{{(courses | filter:{paperId:null}).length}}</span>门课程没启用试卷
		</div>
		<div ng-show="selected" class="panel panel-default">
			<h4 class="padder">{{selected.courseCode}} {{selected.courseName}}
				<span class="text-success" ng-show="selected && selected.paperId">（已启用）</span>
			</h4>
			<div class="panel-body">
				<table class="table table-striped">
					<thead>
						<tr>
							<th>#</th>
							<th>试卷编号</th>
							<th>状态</th>
							<th>教材名</th>
							<th>编者</th>
							<th>出版社</th>
							<th>版次</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<tr ng-repeat="row in papers" ng-class="{'text-success':selected.paperId == row.id}">
							<td>{{$index+1}}</td>
							<td>{{row.code}}</td>
							<td>{{row.status | paperStatus}}</td>
							<td>{{row.bookName}}</td>
							<td>{{row.bookAuthor}}</td>
							<td>{{row.bookPress}}</td>
							<td>{{row.bookPressYear}}</td>
							<td>
							<span ng-if="selected.paperId != row.id">
							<a href="javascript:void(0)" ng-click="assignPaper(row)">
									<i class="glyphicon glyphicon-link"></i>&nbsp;启用</a>
							</span>
								<span class="text-success" ng-show="selected.paperId == row.id">&#8730;已启用</span>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
</div>