Skip to content

Instantly share code, notes, and snippets.

@shibha
Created March 7, 2013 06:52
Show Gist options
  • Save shibha/5106045 to your computer and use it in GitHub Desktop.
Save shibha/5106045 to your computer and use it in GitHub Desktop.
Gist
<div ng-controller="RequisitionNonFullSupplyController">
<div class="clearfix">
<input type="button" ng-click="showAddNonFullSupplyModal()" class = "pull-right btn btn-primary" ng-disabled="formDisabled || !(addNonFullSupplyLineItemButtonShown.visible)" value="Add"/>
</div>
<div class="rnr-table">
<table id="nonFullSupplyTable" class="table table-striped table-bordered" ng-show="pageLineItems.length > 0">
<thead>
<tr>
<th class="col-{{programRnrColumn.name}}" ng-repeat="programRnrColumn in visibleColumns"
ng-hide="programRnrColumn.name == 'quantityApproved'" ng-bind="programRnrColumn.label"></th>
</tr>
</thead>
<tbody ng-show="visibleColumns && pageLineItems.length > 0">
<tr ng-repeat="rnrLineItem in pageLineItems">
<td class="cell-input" ng-repeat="column in visibleColumns"
ng-hide="column.name == 'quantityApproved'">
<ng-switch on="column.name">
<span ng-switch-when="remarks">
<input ng-disabled="formDisabled" id="{{getId('L', $parent)}}" type="text"
name="remarks{{rnrLineItem['id']}}"
ng-model="rnrLineItem[column.name]"
maxlength="250"/>
</span>
<span ng-switch-when="quantityRequested">
<input ng-disabled="formDisabled" id="{{getId('J', $parent)}}" type="text"
name="quantityRequested{{rnrLineItem['id']}}"
ng-model="rnrLineItem.quantityRequested"
ng-required="true"
ng-class="highlightRequired(rnrLineItem[column.name])"
rnr-validator="positiveInteger" maxlength="8"
ng-change="rnrLineItem.fillPacksToShipBasedOnCalculatedOrderQuantityOrQuantityRequested(rnr)"/>
<span class="rnr-form-error" id="quantityRequested{{rnrLineItem['id']}}"
style="display:none;">
Enter Numeric Data
</span>
</span>
<span ng-switch-when="reasonForRequestedQuantity">
<input ng-disabled="formDisabled" id="{{getId('W', $parent)}}" type="text"
name="reasonForRequestedQuantity{{rnrLineItem['id']}}"
ng-model="rnrLineItem[column.name]"
ng-required="true"
ng-class="highlightWarning(rnrLineItem.reasonForRequestedQuantity)"
maxlength="250"/>
<span class="alert alert-warning reason-request"
ng-show="rnrLineItem.quantityRequested && !rnrLineItem.reasonForRequestedQuantity">
Please enter a reason
</span>
</span>
<span ng-switch-when="price">
<span ng-bind="currency" class="cell-text"></span>
<span ng-bind="rnrLineItem[column.name] | number:'2'" class="cell-text"></span>
</span>
<span ng-switch-when="cost">
<span ng-bind="currency" class="cell-text"></span>
<span ng-bind="rnrLineItem[column.name] | number:'2'" class="cell-text"></span>
</span>
<span ng-switch-when="lossesAndAdjustments">
<span ng-bind="rnrLineItem['totalLossesAndAdjustments']" class="cell-text"></span>
</span>
<span ng-switch-default ng-bind="rnrLineItem[column.name]" class="cell-text"></span>
</ng-switch>
</td>
</tr>
</tbody>
</table>
</div>
<form name="nonFullSupplyForm">
<div id="nonFullSupplyProductsModal" modal="nonFullSupplyProductsModal">
<div class="modal-header"><h3>Add Non-Full Supply Products</h3></div>
<div class="modal-body">
<span class="span3">
<label for="nonFullSupplyProductsCategory">Category:</label>
<select id="nonFullSupplyProductsCategory" ng-model="nonFullSupplyProductCategory" name="productName"
ng-options="nonFullSupplyProductCategory.name for nonFullSupplyProductCategory in nonFullSupplyProductsCategories">
<option value="">--select category--</option>
</select>
</span>
<span class="span3">
<label for="nonFullSupplyProductsName">Product:</label>
<select id="nonFullSupplyProductsName" ng-model="facilityApprovedProduct" name="productName"
ng-options="facilityApprovedProduct.programProduct.product.primaryName for facilityApprovedProduct in nonFullSupplyProductsToDisplay">
<option value="">--select product--</option>
</select>
</span>
<span class="span3">
<label for="nonFullSupplyProductsCode">Product Code:</label>
<select id="nonFullSupplyProductsCode" ng-model="facilityApprovedProduct" name="productCode"
ng-options="facilityApprovedProduct.programProduct.product.code for facilityApprovedProduct in nonFullSupplyProductsToDisplay">
<option value="">--select product code--</option>
</select>
</span>
<span class="span3">
<span>
<label for="quantityRequested"><span
ng-bind="labelForRnrColumn('quantityRequested')"></span></label>
<input name="newNonFullSupply.quantityRequested" ng-model="newNonFullSupply.quantityRequested"
id="quantityRequested"
rnr-validator="positiveInteger" maxlength="8"/><br>
<span class="rnr-form-error" style="display:none;" id="newNonFullSupply.quantityRequested">
Enter Numeric Data
</span>
</span>
</span>
<span class="span3">
<label for="reasonForRequestedQuantity"><span
ng-bind="labelForRnrColumn('reasonForRequestedQuantity')"></span></label>
<textarea maxlength="250" rows="4" ng-model="newNonFullSupply.reasonForRequestedQuantity"
id="reasonForRequestedQuantity"></textarea><br>
<span class="alert alert-warning reason-request"
ng-show="newNonFullSupply.quantityRequested && !newNonFullSupply.reasonForRequestedQuantity">
Please enter a reason
</span>
</span>
</div>
<div class="modal-footer">
<span class="pull-left span1">
<input type="button" href="" id="addNonFullSupply" class="btn btn-primary" ng-click="addNonFullSupplyLineItem()"
ng-disabled="shouldDisableAddButton()" value="Add"/>
</span>
<span class="pull-left span1">
<input type="reset" class="btn btn-success save-button" value="Close" ng-click="nonFullSupplyProductsModal=false" />
</span>
</div>
</div>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment