<commit_before><!--
  ~ This program was produced for the U.S. Agency for International Development. It was prepared by the USAID | DELIVER PROJECT, Task Order 4. It is part of a project which utilizes code originally licensed under the terms of the Mozilla Public License (MPL) v2 and therefore is licensed under MPL v2 or later.
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the Mozilla Public License as published by the Mozilla Foundation, either version 2 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public License for more details.
  ~
  ~ You should have received a copy of the Mozilla Public License along with this program. If not, see http://www.mozilla.org/MPL/
  -->

<div xmlns="http://www.w3.org/1999/html" tab-scroll>
    <div ng-hide="requisitionGroup.id"><h2>Add Requisition Group</h2></div>
    <div ng-show="requisitionGroup.id">
        <h2>Edit Requisition Group</h2>
    </div>

    <form ng-submit="saveRequisitionGroup()" id="create-requisition-group" name="requisitionGroupForm" novalidate
          select2-blur>
        <div class="app-form">
            <div>
                <div class="form-row clearfix">
                    <div class="form-cell">
                        <div>
                            <label for="code">Code: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <input ng-model="requisitionGroup.code" name="code" id="code" type="text" maxlength="30"
                                       width="200px"
                                       ng-required="true"/>
                              <span class="field-error" ng-show="requisitionGroupForm.name.$error.required && showError"
                                    openlmis-message="missing.value">
                              </span>
                            </div>
                        </div>
                        <div>
                            <label for="name">Name: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <input ng-model="requisitionGroup.name" name="name" id="name" type="text" maxlength="30"
                                       width="320px"
                                       ng-required="true" ng-change="validateRequisitionGroupName()"/>
                                  <span class="field-error" ng-show="requisitionGroup.name.$error.required && showError"
                                        openlmis-message="missing.value">
                                  </span>

                                  <span class="field-error" ng-show="requisitionGroupNameInvalid">
                                      Invalid requisition group name
                                  </span>
                            </div>
                        </div>
                        <div>
                            <label for="supervisoryNode">Supervisory Node: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <select style="width:320px" ng-required="true" name="supervisoryNode"
                                        id="supervisoryNode" ng-model="requisitionGroup.supervisoryNode.id"
                                        ng-options="option.id as option.name for option in supervisoryNodes">
                                </select>
                            </div>
                        </div>
                        <div>
                            <label for="description">Description: </label>

                            <div class="form-field">
                                <textarea style="width:350px" ng-model="requisitionGroup.description" name="description"
                                          id="description"
                                          type="text" maxlength="200" rows="5"
                                          ng-required="false"></textarea>
                            </div>
                        </div>
                        <div form-toolbar id="action_buttons" class="action-buttons">
                            <div class="form-cell button-row">
                                <input type="submit" class="btn btn-primary save-button" value="Save"/>
                                <a ng-href="#/list" class="btn btn-cancel cancel-button"><span
                                        openlmis-message="button.cancel"></span></a>
                                <input type="button" class="btn btn-danger delete-button" value="Delete"
                                       ng-click="showRemoveRequisitionGroupConfirmDialog()"/>
                            </div>
                            <div class="toolbar-error" id="saveErrorMsgDiv" ng-bind="error" ng-show="error"/>
                        </div>
                    </div>
                </div>
            </div>
            <div>
                <div class="alert alert-success" id="saveSuccessMsgDiv" ng-show="requisitionGroupMemberId">
                    <span ng-bind="message"></span>.
                </div>
                <h2><span>Associated Facilities</span> <br>
                    <input id="txtFilterAssociatedFacilities" class="search-query input-xlarge" type="text" ng-model="facilityFilterToken"
                           ng-keyup="filterAssociatedFacilityList()" placeholder="Filter Facility Name/Code"/>
                    <a ng-click="addNewMemberFacility()"  ng-show="facilitiesLoaded" class="pull-right btn btn-primary"><span
                            id="requisition-group-facility-add-new">Add New</span></a>
                </h2>
                <table class="table table-striped table-bordered">
                    <thead>
                    <tr class="gradient-header">

                        <th>Facility Name
                        </th>
                        <th>Type
                        </th>
                        <th>Action
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="facility in associatedfacilitiesFiltered">
                        <td>
                            <div>{{facility.code}} - {{facility.name}}</div>
                        </td>
                        <td>
                            <div>{{facility.facilityType.name}}</div>
                        </td>
                        <td>
                            <a href="" class="btn btn-danger" ng-click="showRemoveRequisitionGroupMemberConfirmDialog($index)">Remove</a>
                        </td><commit_msg>ELMIS-1151: show the member facilities under a requistion group that is being edited.<commit_after><!--
  ~ This program was produced for the U.S. Agency for International Development. It was prepared by the USAID | DELIVER PROJECT, Task Order 4. It is part of a project which utilizes code originally licensed under the terms of the Mozilla Public License (MPL) v2 and therefore is licensed under MPL v2 or later.
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the Mozilla Public License as published by the Mozilla Foundation, either version 2 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public License for more details.
  ~
  ~ You should have received a copy of the Mozilla Public License along with this program. If not, see http://www.mozilla.org/MPL/
  -->

<div xmlns="http://www.w3.org/1999/html" tab-scroll>
    <div ng-hide="requisitionGroup.id"><h2>Add Requisition Group</h2></div>
    <div ng-show="requisitionGroup.id">
        <h2>Edit Requisition Group</h2>
    </div>

    <form ng-submit="saveRequisitionGroup()" id="create-requisition-group" name="requisitionGroupForm" novalidate
          select2-blur>
        <div class="app-form">
            <div>
                <div class="form-row clearfix">
                    <div class="form-cell">
                        <div>
                            <label for="code">Code: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <input ng-model="requisitionGroup.code" name="code" id="code" type="text" maxlength="30"
                                       width="200px"
                                       ng-required="true"/>
                              <span class="field-error" ng-show="requisitionGroupForm.name.$error.required && showError"
                                    openlmis-message="missing.value">
                              </span>
                            </div>
                        </div>
                        <div>
                            <label for="name">Name: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <input ng-model="requisitionGroup.name" name="name" id="name" type="text" maxlength="30"
                                       width="320px"
                                       ng-required="true" ng-change="validateRequisitionGroupName()"/>
                                  <span class="field-error" ng-show="requisitionGroup.name.$error.required && showError"
                                        openlmis-message="missing.value">
                                  </span>

                                  <span class="field-error" ng-show="requisitionGroupNameInvalid">
                                      Invalid requisition group name
                                  </span>
                            </div>
                        </div>
                        <div>
                            <label for="supervisoryNode">Supervisory Node: <span class="label-required"> *</span></label>

                            <div class="form-field">
                                <select style="width:320px" ng-required="true" name="supervisoryNode"
                                        id="supervisoryNode" ng-model="requisitionGroup.supervisoryNode.id"
                                        ng-options="option.id as option.name for option in supervisoryNodes">
                                </select>
                            </div>
                        </div>
                        <div>
                            <label for="description">Description: </label>

                            <div class="form-field">
                                <textarea style="width:350px" ng-model="requisitionGroup.description" name="description"
                                          id="description"
                                          type="text" maxlength="200" rows="5"
                                          ng-required="false"></textarea>
                            </div>
                        </div>
                        <div form-toolbar id="action_buttons" class="action-buttons">
                            <div class="form-cell button-row">
                                <input type="submit" class="btn btn-primary save-button" value="Save"/>
                                <a ng-href="#/list" class="btn btn-cancel cancel-button"><span
                                        openlmis-message="button.cancel"></span></a>
                                <input type="button" class="btn btn-danger delete-button" value="Delete"
                                       ng-click="showRemoveRequisitionGroupConfirmDialog()"/>
                            </div>
                            <div class="toolbar-error" id="saveErrorMsgDiv" ng-bind="error" ng-show="error"/>
                        </div>
                    </div>
                </div>
            </div>
            <div>
                <div class="alert alert-success" id="saveSuccessMsgDiv" ng-show="requisitionGroupMemberId">
                    <span ng-bind="message"></span>.
                </div>
                <h2><span>Associated Facilities</span> <br>
                    <input id="txtFilterAssociatedFacilities" class="search-query input-xlarge" type="text" ng-model="facilityFilterToken"
                           ng-keyup="filterAssociatedFacilityList()" placeholder="Filter Facility Name/Code"/>
                    <a ng-click="addNewMemberFacility()"  ng-show="facilitiesLoaded" class="pull-right btn btn-primary"><span
                            id="requisition-group-facility-add-new">Add New</span></a>
                </h2>
                <table class="table table-striped table-bordered">
                    <thead>
                    <tr class="gradient-header">

                        <th>Facility Name
                        </th>
                        <th>Type
                        </th>
                        <th>Action
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="facility in facilities | filter:facilityFilterToken">
                        <td>
                            <div>{{facility.code}} - {{facility.name}}</div>
                        </td>
                        <td>
                            <div>{{facility.facilityType.name}}</div>
                        </td>
                        <td>
                            <a href="" class="btn btn-danger" ng-click="showRemoveRequisitionGroupMemberConfirmDialog($index)">Remove</a>
                        </td>
{'fraction_non_alphanumeric': 0.1076680295531167, 'fraction_numerical': 0.0054515458001578075, 'mean_word_length': 1.246897663174859, 'pattern_counts': {'":': 0, '<': 225, '<?xml version=': 0, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '424511', 'n_tokens_mistral': 3333, 'n_tokens_neox': 3052, 'n_words': 764}