@include('admin.author.angular_edit_author')
<div ng-controller="MyController">
	
		<table class="table table-bordered table-striped" ng-if="tasks.length > 0">
			
			<tr>
				<th>No.</th>
				
				<th>ORC ID</th>
				<th>First Name</th>
				<th>Last Name</th>
				<th>email</th>
				<th>Affiliation</th>
				<th>Action</th>
			</tr>
			
			<tr ng-repeat="(index, task) in tasks">
				
				<td>
					 {[{ index + 1 }]}
					 <input type="hidden" name="author_id[]" value="{[{ task.author_id }]}" />
				</td>
				<td> {[{ task.orcid }]}</td>
				<td> {[{ task.first_name }]}</td>
				<td> {[{ task.last_name }]}</td>
				<td> {[{ task.email }]}</td>
				<td> <a class="btn btn-raised btn-info btn-sm" onclick="get_affiliation({[{ task.author_id }]});" data-toggle="modal" data-href="#author_affiliation" href="#author_affiliation">Manage</a>
				</td>

				<td nowrap>
				
				
					<button type="button" class="btn btn-success btn-xs" ng-click="EditAuthor(index)" >Edit</button>
					<button type="button" class="btn btn-danger btn-xs" ng-click="deleteAuthor(index)" >Delete</button>
				
				
				</td>
			</tr>
		</table>
	
    
	
	
	<div class="form-group col-lg-12 col-md-12 col-sm-12">
		<h3>{[{ author_heading }]}</h3>
	</div>
	
	<div class="form-group col-lg-1 col-md-1 col-sm-1">
				<label class="control-label">Principle:</label>
				<input type="checkbox" ng-model="principle"  class="input-md" placeholder="Principle" ng-checked="principle" ng-value="principle">
			</div>
	
			<div id="div_author_type" class="form-group col-lg-3 col-md-3 col-sm-3">
			<label class="control-label">Author Type:</label>
			<select class="form-control" id="author_type" ng-model="author_type">
				<option value="">Author Type</option>
				<option  value="a" >Author</option>
				<option  value="ca" >Co-Author</option>
				<option  value="e" >Editor</option>
				<option  value="ce" >Co-Editor</option>
				<option  value="ge" >Guest-Editor</option>								<option  value="ae" >Assistant Editor</option>
			</select>
			
			</div>
			
			<div id="div_orcid" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">ORC ID:</label>
				<input type="text" ng-model="orcid"  class="form-control input-md" placeholder="ORCID">
			</div>

			<div id="div_sequence" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">Sequence:</label>
				<input type="text" ng-model="sequence"  class="form-control input-md" placeholder="Sequence">
			</div>

			<div id="div_email" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">Email:</label>
				<input ng-model="email" type="text" id="email" class="form-control input-md" placeholder="email" >
			</div>
			<div id="div_h_index" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">H index:</label>
				<input type="number" ng-model="h_index" class="form-control input-md" placeholder="h index">
			</div>
			<div id="div_country" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">Country:</label>
				<select class="form-control" id="country" ng-model="country">
				<option value="">Country</option>
					@foreach ($country as $countries)
					<option value="{{$countries->printable_name}}"> {{$countries->printable_name}}</option>
					@endforeach
				</select>
			</div>
			<div id="div_first_name" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">first_name:</label>
				<input type="text" ng-model="first_name" class="form-control input-md" placeholder="first_name" >
			</div>
			<div id="div_initials" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">Initials:</label>
				<input type="text" ng-model="initials" class="form-control input-md" placeholder="Initials">
			</div>
			<div id="div_last_name" class="form-group col-lg-4 col-md-4 col-sm-4">
				<label class="control-label">last_name:</label>
				<input type="text" ng-model="last_name"  class="form-control input-md" placeholder="last_name" >
			</div>
			
			
			<div class="form-group col-lg-12 col-md-12 col-sm-12">
				<div ng-switch="action">
					<div ng-switch-when="INSERT">
						<input id="AddAuthor" class="btn btn-success btn-xs " type="button" ng-click="AddAuthor()" value="Add Author" />
					</div>
					<div ng-switch-when="UPDATE">
						<input id="UpdateAuthor" class="btn btn-success btn-xs " type="button" ng-click="UpdateAuthor()" value="Update Author" />
					</div>
				</div>
			</div>
			
			<div style="clear:both;"></div>
</div>