<div class="content">

  <div class="text-left">
    <h1>{{ 'notifications.title' | tr }} <button class="btn btn-primary btn-outline pull-right" ng-click="notifications.clearAll()" ng-disabled="clearAllBusy"><i class="fa fa-circle-notch fa-spin" ng-show="clearAllBusy"></i><i class="fa fa-check" ng-hide="clearAllBusy"></i> {{ 'notifications.clearAll' | tr }}</button></h1>
  </div>

  <div class="col-lg-12 text-center" ng-show="notifications.busy">
    <h2><i class="fa fa-circle-notch fa-spin"></i></h2>
  </div>

  <div class="card" ng-hide="notifications.busy || notifications.notifications.length">
    <div class="row">
      <div class="col-xs-12">
          <h3 class="text-center" style="margin: 20px;">{{ 'notifications.nonePending' | tr }}</h3>
      </div>
    </div>
  </div>

  <div class="card notification-item" ng-repeat="notification in notifications.notifications">
    <div class="row">
      <div class="col-xs-12" ng-click="notification.isCollapsed = !notification.isCollapsed" ng-class="{ 'notification-details': notification.detailsShown }">
        {{ notification.title }} <small class="text-muted" uib-tooltip="{{ notification.creationTime | prettyLongDate }}">{{ notification.creationTime | prettyDate }}</small>
        <button class="btn btn-xs btn-default pull-right" ng-hide="notification.acknowledged" ng-click="notifications.ack(notification, $event)" uib-tooltip="{{ 'notifications.dismissTooltip' | tr }}"><i class="fa fa-times"></i></button>

        <div uib-collapse="notification.isCollapsed" expanding="notificationExpanding(notification)">
          <br/>
          <p ng-hide="notification.messageJson" ng-click="$event.stopPropagation();" style="cursor: auto; overflow: auto;" ng-bind-html="notification.message | markdown2html"></p>
          <pre ng-show="notification.messageJson" ng-click="$event.stopPropagation();" style="cursor: auto">{{ notification.messageJson | json }}</pre>
          <button type="button" class="btn btn-danger pull-right" ng-click="$event.stopPropagation(); $parent.reboot.show()" ng-show="notification.title === 'Reboot Required'" ng-disabled="reboot.busy"><i class="fa fa-circle-notch fa-spin" ng-show="reboot.busy"></i> {{ 'main.action.reboot' | tr }}</button>
        </div>
      </div>
    </div>
  </div>
</div>
