<nettest.detail class="nettest-detail"></nettest.detail>
<div class="row selected-nettest" ng-show="selectedNetTest">
  <div>
    <h2>{{selectedNetTest.name}}</h2>
    <div>
      version: <span class="badge badge-success">{{selectedNetTest.version}}</span>
      <form name="netTestOptions" class="nettest-options">
        <div class="row">

          <div class="col-md-4 form-group"
               ng-repeat="(name, options) in selectedNetTest.options">
            <label>{{name}}</label>
            <div class="input-group" ng-if="options.type=='file/url'">
              <select class="form-control"
                  ng-model="selectedNetTest.arguments[name].value">
                <option ng-repeat="(id, input) in inputs"
                        value="${{id}}">{{input.name}}
                </option>
              </select>
              <div class="input-group-addon file-info" ng-if="selectedNetTest.arguments[name].value">
                <button class="btn"
                        ng-click="showFileContents(selectedNetTest.arguments[name].value)">
                  <i class="fa fa-info-circle"></i>
                </button>
              </div>
            </div>

            <input class="form-control"
                ng-if="options.type!='file/url'"
                ng-model="selectedNetTest.arguments[name].value"
                type="{{options.type}}">

          </div>

          <div class="col-md-4 form-group"
               ng-if="showAdvancedOptions"
               ng-repeat="(name, options) in selectedNetTest.advancedOptions">
            <label>{{name}}</label>
            <input class="form-control"
                ng-if="options.type=='file'"
                ng-model="selectedNetTest.arguments[name].value"
                type="text">

            <input class="form-control"
                ng-if="options.type!='file'"
                ng-model="selectedNetTest.arguments[name].value"
                type="{{options.type}}">

          </div>
        </div>

        <div class="row">
          <div class="col-md-6">
              <button class="btn btn-primary"
                      ng-click="showAdvancedOptions = !showAdvancedOptions">
                more options
              </button>
              <button class="btn btn-primary" ng-click="startNetTest()">
              Start Net Test
              </button>
            </div>
        </div>

      </form>

    </div>
  </div>
</div>

<div class="row" ng-if="inputContent">
  <h2>The following URLs will be tested</h2>
  <button class="btn" ng-click="hideFileContents()">close</button>
  <ul>
    <li ng-repeat="input in inputContent">{{input}}</li>
  </ul>
</div>

<div class="row">

  <div class="alert alert-warning" ng-if="!$root.directorStarted">
    <strong>Warning</strong>
    ooniprobe has not started yet. Please wait for it to start running tests.
  </div>

  <ul class="nettest-cards">
    <li ng-repeat="(name, details) in supportedNetTests">
      <h3 class="nettest-name">{{details.name}}</h3>
      <span class="label nettest-category-{{details.category}}">
          {{details.category}}
      </span>
      <span class="label label-default">version: {{details.version}}</span>
      <p class="nettest-description">{{details.description}}</p>
      <button class="btn"
              ui-sref="nettest.detail({id: details.id})"
              ui-sref-active="active" ui-sref-opts="{reload: true}">More Info</button>
      <button class="btn btn-default"
              ng-disabled="!$root.directorStarted"
              ng-click="runNetTest(details.id)">Run</button>

    </li>
  </ul>

  <button class="btn" ng-if="false"
          ng-click="showExperimental=!showExperimental">Show
    experimental tests</button>
  <ul class="nettest-cards" ng-if="showExperimental">
    <li ng-repeat="(name, details) in experimentalNetTests">
      <h3 class="nettest-name">{{details.name}}</h3>
      <span class="label nettest-category-{{details.category}}">
          {{details.category}}
      </span>
      <span class="label label-default">version: {{details.version}}</span>
      <p class="nettest-description">{{details.description}}</p>

      <button class="btn"
              ui-sref="nettest.detail({id: details.id})"
              ui-sref-active="active" ui-sref-opts="{reload: true}">More Info</button>

      <button class="btn btn-default"
              ng-disabled="!$root.directorStarted"
              ng-click="runNetTest(details.id)">Run</button>
    </li>
  </ul>

</div>
