<div ng-controller="Quartz.QuartzController">

  <div class="span12 well" ng-hide="selectedScheduler">
    <form>
      <p>The Quartz plugin allows you to see details about running Quartz Schedulers, and their associated triggers and
        jobs.</p>

      <p>Select a Quartz Scheduler in the tree to continue.</p>
    </form>
  </div>

  <div ng-show="selectedScheduler" class="row-fluid">

    <div class="row-fluid">
      <div class="pull-left">
        <form class="form-inline no-bottom-margin">
          <fieldset>
            <div class="controls control-group inline-block controls-row">
              <div class="btn-group">
                <button
                    ng-disabled="gridOptions.selectedItems.length == 0 || gridOptions.selectedItems[0].state != 'PAUSED'"
                    class="btn" ng-click="resumeTrigger()" title="Resume trigger">
                  <i class="icon-play-circle"></i></button>
                <button
                    ng-disabled="gridOptions.selectedItems.length == 0 || gridOptions.selectedItems[0].state == 'PAUSED'"
                    class="btn" ng-click="pauseTrigger()" title="Pause trigger">
                  <i class="icon-off"></i></button>
                <button
                    ng-disabled="gridOptions.selectedItems.length == 0"
                    class="btn" ng-click="onBeforeUpdateTrigger()" title="Update trigger">
                  <i class="icon-edit"></i></button>
              </div>
            </div>
          </fieldset>
        </form>
      </div>

      <div hawtio-confirm-dialog="showTriggerDialog" ok-button-text="Update" on-ok="onUpdateTrigger()"
           title="Update trigger: {{gridOptions.selectedItems[0].group}}/{{gridOptions.selectedItems[0].name}}">
        <div class="dialog-body">
          <div simple-form data='triggerSchema' entity='updatedTrigger'>
          </div>
        </div>
      </div>

      <div class="pull-right">
        <form class="form-inline no-bottom-margin">
          <fieldset>
            <div class="control-group inline-block">
              <input type="text" class="search-query" placeholder="Filter..." ng-model="gridOptions.filterOptions.filterText">
            </div>
          </fieldset>
        </form>
      </div>
    </div>

    <div class="row-fluid">
      <table class="table table-condensed table-striped" hawtio-simple-table="gridOptions"></table>
    </div>

  </div>

</div>

