eHealthAfrica/direct-delivery-dashboard

View on GitHub
src/app/configurations/allocations/assumptions/assumptions.html

Summary

Maintainability
Test Coverage
<div class="clearfix assumptions">
  <button class="btn btn-success btn-lg pull-right adjust-up"
          ng-click="assumptionsCtrl.createNewTemplate(assumptionsCtrl.docTypes.assumptions)">
    <i class="fa fa-plus"></i>
    <span>Create New Template</span>
  </button>
</div>
<br/><br/>
<div>
  <div class="alert alert-info" ng-show="!assumptionsCtrl.showTable()">
    <i class="fa fa-info"></i>
    <span>Assumption template does not exist, please create new one</span>
  </div>
</div>
<div>
  <table ng-if="assumptionsCtrl.showTable()" class="table table-bordered">
    <thead>
    <th>Name</th>
    <th>Description</th>
    <th>Primary State</th>
    <th>Primary Year</th>
    <th></th>
    </thead>
    <tbody>
    <tr ng-repeat="template in assumptionsCtrl.assumptionList track by $index" ng-class="{'bg-success': template.new}">
      <td>{{template._id || template.id}}</td>
      <td ng-bind="template.description"></td>
      <td ng-bind="template.primary.state"></td>
      <td ng-bind="template.primary.year"></td>
      <td>
        <a class="btn btn-info" ui-sref="configurations.allocations.allocationView({id: template._id})">
          <i class="fa fa-eye"></i>
          <em>View</em>
        </a>
        <a class="btn btn-primary" ng-click="assumptionsCtrl.editTemplate(template)">
          <i class="fa fa-wrench"></i>
          <em>Edit</em>
        </a>
      </td>
    </tr>
    </tbody>
  </table>
</div>