<h4 class="bg-primary">Select a base station from the list</h4>

<form action="" name="addBStationForm" ng-submit="finish()" novalidate>
  
  <div ng-if="baseStations.length">
    <div class="form-group">
      <label for="bstation-dtext">Enter a name for this base station</label>
      <input class="form-control" name="displayText" id="bstation-dtext" type="text" placeholder="Base station name" ng-model="addBaseStation.displayText" ng-maxlength="32" required>
      <p class="help-block" ng-show="addBStationForm.displayText.$error.required && addBStationForm.displayText.$dirty">A valid base station name is required.</p>
      <p class="help-block" ng-show="addBStationForm.displayText.$error.maxlength && addBStationForm.displayText.$dirty">The base station name cannot be longer than 32 characters.</p>
    </div> 
  </div>

  
  <p>Choose an available base station for the room (listed by MAC address).</p>
  <p>Here are the base stations which have been found on the network</p>

  <refresh-hardware reset="addBaseStation.selection" ng-model="baseStations" device-type="bsType"></refresh-hardware>

  <div class="alert alert-warning margin-top-md" role="alert" ng-if="!baseStations.length">
    <i class="fa fa-warning"></i>&nbsp;&nbsp;<strong>No Base Stations Found</strong>
    <p>There were no available base stations found on your network.</p>
  </div>  

  <div ng-if="baseStations.length">
    <div class="radio" ng-repeat="baseStation in baseStations track by baseStation.mac">
      <label>
        <input type="radio" name="baseStation" ng-model="addBaseStation.selection" id="base-station-{{$index}}" ng-change="changedValue()" ng-value="baseStation" required>
        {{baseStation.mac | macAddress}} <span class="text-muted">({{baseStation.name}})</span>
      </label>
    </div>
  </div>

  <div class="left-and-right">
    <go-back state="menu.programming.options"></go-back>
    <button class="btn btn-primary" type="submit" ng-disabled="addBStationForm.$invalid || !baseStations.length"> Finish</i></button>
  </div>
</form>



    