<div ng-show="add.form" class="vis-editor-agg-add-schemas">
  <label>Select {{ groupName }} type</label>
  <ul class="form-group list-group list-group-menu">
    <li
      ng-repeat="schema in availableSchema"
      ng-click="add.submit(schema)"
      class="list-group-item list-group-menu-item">
      <i ng-show="schema.icon" ng-class="schema.icon"></i>
      {{schema.title}}
    </li>
  </ul>
</div>

<div
  ng-if="stats.max > stats.count"
  ng-init="add.form = stats.count < 1 ? !add.form : add.form"
  ng-click="add.form = !add.form"
  class="vis-editor-agg-wide-btn">

  <div ng-if="!add.form">
    <div class="vis-editor-agg-wide-btn-add" ng-if="groupName !== 'buckets' || !stats.count">
      <i aria-hidden="true" class="fa fa-plus"></i> Add {{ groupName }}
    </div>
    <div class="vis-editor-agg-wide-btn-add" ng-if="groupName === 'buckets' && stats.count > 0">
      <i aria-hidden="true" class="fa fa-code-fork"></i> Add sub-{{ groupName }}
    </div>
  </div>
  <div class="vis-editor-agg-wide-btn-add" ng-if="add.form">
    Cancel
  </div>
</div>