<div class='col-sm-9 text-left'> 
	<h3>Reset Password</h3>
	<hr>
	
  <!-- only show the following message when a user is not selected -->
  <p class='alert alert-success' ng-show='!selected.id'>Please select a user to begin.</p>

  <!-- success/error message for reset password function -->
  <div uib-alert ng-repeat="a in alert.alerts" ng-class="'alert-' + a.type" close="alert.closeAlert($index)">{{a.msg}}</div>

  <!-- RESET PASSWORD PANEL -->
  <!-- populate the reset password table on page load with list of officers -->
  <div class='panel panel-primary' ng-init='getOfficers()'>
    <div class='panel-body'>
     <div>
      <table class="table table-striped table-hover" style='margin:auto; width:100%'> 

      <!-- search bar for officers -->
       <form class='form-inline'>
        <div class='form-group'>
         <label>Search</label>
         <input type='text' ng-model='search' class='form-control' placeholder='Search'>
       </div>
     </form>

     <!-- table headers -->
     <thead>
      <tr>
       <th class='text-center'>Select</th>
       <th>First Name</th>
       <th>Last Name</th>
       <th>Username</th>
       <th>Role</th>
       <th>Reset Password</th>
     </tr>
   </thead>

   <!-- table body -->
   <tbody>
    <tr ng-repeat='officer in officers|filter:search' ng-class='{success: $index === pick}' >
     <td class='text-center'><input type='radio' ng-model='selected.id' value='{{officer.id}}' ng-click='select($index)' required></td>
     <td>{{officer.firstName}}</td>
     <td>{{officer.lastName}}</td>
     <td>{{officer.username}}</td>
     <td>{{officer.role}}</td> 
     <td>
       <!-- inline form; reset password fields -->
       <form class='form-inline' ng-submit='resetPassword(reset_pass, reset_pass_conf)'>
        <div class='form-group'>
          <input ng-disabled='!is_selected($index)' ng-model='reset_pass' type='password' class='fields' pattern='{{password_pattern}}' title='{{pattern_descr}}' placeholder='New password' required>
          <input ng-disabled='!is_selected($index)' ng-model='reset_pass_conf' type='password' class='fields' placeholder='Confirmation' required>
          <button ng-disabled='!is_selected($index)' type='submit' class='btn btn-default' style="margin-left: 1em;">Reset</button>
        </div>
       </form>							
     </td>
    </tr>
</tbody>
</table>
</div>
</div>
</div>
</div>