eHealthAfrica/direct-delivery-dashboard

View on GitHub
src/app/configurations/products/product.html

Summary

Maintainability
Test Coverage
<div class="panel panel-default">
  <div class="panel-heading clearfix">
    <div class="btn-group btn-group-lg pull-right">
       <button class="btn btn-warning" ui-sref="configurations.products.presentation"><i class="fa fa-list-ol"></i> Presentations</button>
      <button class="btn btn-success" ui-sref="configurations.products.add"><i class="fa fa-plus"></i> Add Product</button>
    </div>
  </div>
  <div class="panel-body">
    <div class="alert alert-info" ng-if="productsCtrl.products.length ===0">
      <i class="fa fa-info-circle"></i>
      Product list could not be retrieved. please reload the page after sometime. if it is still not retrieved, contact site administrator.
    </div>
    <table class="table table-bordered table-striped" ng-if="productsCtrl.products.length > 0">
      <thead>
        <tr>
          <th>Name</th>
          <th>Code</th>
          <th>Description</th>
          <th>Measured in</th>
          <th>Storage Type</th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="product in productsCtrl.products">
          <td ng-bind="product.name"></td>
          <td ng-bind="product.code"></td>
          <td ng-bind="product.description"></td>
          <td ng-bind="product.baseUOM"></td>
          <td ng-bind="product.storageID"></td>
          <td>
            <a class="btn btn-default"
               ui-sref="configurations.products.edit({code:product._id})">
              <i class="fa fa-wrench"></i>
              <span>Edit</span>
            </a>
             <a class="btn btn-info"
                ui-sref="configurations.products.view({code:product._id})">
               <i class="fa fa-eye"></i> View</a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>