<!--
Controller: CaseTypeCtrl
Required vars: caseType
-->
<table>
  <thead>
	  <tr>
	    <th>{{ts('Name')}}</th>
	    <th>{{ts('Assign to Creator')}}</th>
	    <th>{{ts('Is Manager')}}</th>
	    <th></th>
	  </tr>
  </thead>
  <tbody>
	  <tr ng-repeat="relType in caseType.definition.caseRoles | orderBy:'name'" ng-class-even="'crm-entity even-row even'" ng-class-odd="'crm-entity odd-row odd'">
	    <td>{{relType.name}}</td>
	    <td><input type="checkbox" ng-model="relType.creator" ng-true-value="'1'" ng-false-value="'0'"></td>
	    <td><input type="radio" ng-model="relType.manager" value="1" ng-change="onManagerChange(relType)"></td>
	    <td>
	      <a crm-icon="fa-trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.caseRoles,relType)" title="{{ts('Remove')}}"></a>
	    </td>
	  </tr>
  </tbody>

  <tfoot>
	  <tr class="addRow">
	    <td colspan="4">
	      <span crm-add-name
	           crm-options="relationshipTypeOptions"
	           crm-var="newRole"
	           crm-on-add="addRole(caseType.definition.caseRoles, newRole)"
             placeholder="{{ts('Add role')}}"
	              ></span>
	    </td>
	  </tr>
  </tfoot>
</table>
