<div class="header">
  <div class="title">
    <div class="submenu">
      <a ui-sref="motions.motion.list" class="btn btn-sm btn-default">
        <i class="fa fa-angle-double-left fa-lg"></i>
        <translate>Back to overview</translate>
      </a>
      <a href="" os-perms="motions.can_manage" class="btn btn-primary btn-sm" ng-click="create()">
        <i class="fa fa-plus fa-lg"></i>
        <translate>New</translate>
      </a>
    </div>
    <h1 translate>Workflows</h1>
  </div>
</div>

<div class="details">
  <div uib-alert ng-show="alert.show" class="alert-danger" ng-click="alert={}" close="alert={}">
    {{ alert.msg }}
  </div>
  <table class="table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th>
          <translate>Name</translate>
        </th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="workflow in workflows | orderBy: 'name'">
        <td ng-mouseover="workflow.hover=true" ng-mouseleave="workflow.hover=false">
          <strong>{{ workflow.name | translate }}</strong>
          <div class="hoverActions" ng-class="{'hiddenDiv': !workflow.hover}">
            <!-- edit -->
            <a ui-sref="motions.workflow.detail({id: workflow.id})" translate>Edit</a> &middot;
            <!-- delete -->
            <a href="" class="text-danger"
              ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
                <b>{{ workflow.name }}</b>"
              ng-bootbox-confirm-action="delete(workflow)" translate>Delete</a>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
