<div class="panel-alert-list">
  <section class="card-section card-list-layout-list" ng-if="ctrl.panel.show === 'current'">
    <ol class="card-list">
      <li class="card-item-wrapper" ng-repeat="alert in ctrl.currentAlerts">
        <div class="card-item card-item--alert">
          <div class="card-item-body">
            <div class="card-item-details">
              <div class="card-item-notice">
                <a href="dashboard/{{alert.dashboardUri}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert">
                  {{alert.name}}
                </a>
              </div>
              <div class="card-item-sub-name">
                <span class="alert-list-item-state {{alert.stateModel.stateClass}}">
                  <i class="{{alert.stateModel.iconClass}}"></i>
                  {{alert.stateModel.text}}
                </span> for {{alert.newStateDateAgo}}
              </div>
              <div class="small muted" ng-show="alert.executionError">
                {{alert.executionError}}
              </div>
            </div>
          </div>
        </div>
      </li>
    </ol>
  </section>

  <section class="card-section card-list-layout-list" ng-if="ctrl.panel.show === 'changes'">
    <ol class="card-list">
      <li class="card-item-wrapper" ng-repeat="al in ctrl.alertHistory">
        <div class="card-item card-item--alert">
          <div class="card-item-header">
            <div class="card-item-sub-name">{{al.time}}</div>
          </div>
          <div class="card-item-body">
            <div class="card-item-details">
              <div class="card-item-notice">{{al.title}}</div>
              <div class="card-item-sub-name">
                <span class="alert-list-item-state {{al.stateModel.stateClass}}">
                  <i class="{{al.stateModel.iconClass}}"></i>
                  {{al.stateModel.text}}
                </span> {{al.metrics}}
              </div>
            </div>
          </div>
        </div>
      </li>
    </ol>
  </section>
</div>
