<div class="modal center" ng-controller="CourseRelatedBooksCtrl">
<div cg-busy="{promise:myPromise,message:'正在加载...'}"></div>
<div class="modal-dialog" style="max-width: 1200px;width: 1200px;max-height:630px;overflow-y:auto;margin-top: 60px;">
	<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">课程： {{course.code}} - {{course.name}}</h4>
			</div>
	<div class="modal-body">
	<div class="row">
	<div class="col-sm-5">
		<div class="form-inline">
			<label>未选中的教材：</label>
			<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="search()" />
			</div>
		</div>
	  <table class="table table-striped table-bordered">
	  	<tr>
	  		<th class="col-sm-4">教材名称</th>
	  		<th>编者/出版社/版次</th>
	  		<th>操作</th>
	 	</tr>
	 	<tr ng-repeat="row in pageModel.array">
	 		<td>{{row.name}}</td>
			<td>{{row.editor}}/{{row.press}}/{{row.version}}</td>
			<td>
				<button ng-click="addRelatedBook(row)" class="btn btn-default btn-xs">
					<i class="glyphicon glyphicon-arrow-right"></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 class="col-sm-7">
		<span>已选中的教材：</span>
	  <table class="table table-striped table-bordered">
	  	<tr>
	  		<th class="col-md-2">操作</th>
	  		<th>教材名称</th>
	  		<th>编者/出版社/版次</th>
	  		<th>状态</th>
	 	</tr>
	 	<tr ng-repeat="row in relatedBooks" class="{{row.inCourseStatus == 1 ? 'text-success' : ''}}">
	 		<td>
				<button ng-click="deleteRelatedBook(row)" class="btn btn-danger btn-xs">
					<i class="glyphicon glyphicon-trash"></i>								
				</button>
				<button ng-click="enableRelatedBook(row)" class="btn btn-success btn-xs" ng-if="row.inCourseStatus == 0" title="启用">
					<i class="glyphicon glyphicon glyphicon-ok"></i>								
				</button>
			</td>
	 		<td>{{row.name}}</td>
	 		<td>{{row.editor}}/{{row.press}}/{{row.version}}</td>
			<td>{{row.inCourseStatus | enableStatus}}</td>
	 	</tr>
	  </table>
	</div>
	</div>
	</div>
    </div>
    </div>
</div>
