<div class="umb-property-editor umb-listview" ng-controller="Umbraco.PropertyEditors.ListViewController" ng-switch="isNew">

   <div class="row-fluid" ng-switch-when="true">

   </div>

   <div class="row-fluid" ng-switch-when="false">

       <umb-editor-sub-header ng-class="{'--state-selection':(selection.length > 0)}">

           <umb-editor-sub-header-content-left>

               <umb-editor-sub-header-section ng-if="(listViewAllowedTypes && listViewAllowedTypes.length > 0 && (selection.length == 0)) && (currentNodePermissions == null || currentNodePermissions.canCreate)">

                   <div class="btn-group" ng-show="createAllowedButtonSingle">
                       <a class="btn btn-white" ng-click="createBlank(entityType,listViewAllowedTypes[0].alias)">
                           <localize key="actions_create">Create</localize> {{listViewAllowedTypes[0].name}}
                       </a>
                   </div>

                   <div class="btn-group" ng-show="createAllowedButtonSingleWithBlueprints">
                       <a class="btn btn-white dropdown-toggle" data-toggle="dropdown" ng-href="">
                           <span ng-click="createBlank(entityType,listViewAllowedTypes[0].alias)">
                               <localize key="actions_create">Create</localize> {{listViewAllowedTypes[0].name}}
                           </span>
                           <span class="caret" ng-click="page.createDropdownOpen = !page.createDropdownOpen"></span>
                       </a>

                       <umb-dropdown ng-if="page.createDropdownOpen" on-close="page.createDropdownOpen = false">
                           <umb-dropdown-item ng-repeat="blueprint in listViewAllowedTypes[0].blueprints | orderBy:'name':false">
                               <a ng-click="createFromBlueprint(entityType, listViewAllowedTypes[0].alias, blueprint.id)">
                                   <i class="{{::listViewAllowedTypes[0].icon}}"></i>
                                   {{::blueprint.name}}
                               </a>
                           </umb-dropdown-item>
                       </umb-dropdown>
                   </div>

                   <div class="btn-group" ng-show="createAllowedButtonMultiWithBlueprints">
                       <a class="btn btn-white dropdown-toggle" data-toggle="dropdown" ng-href="" ng-click="page.createDropdownOpen = !page.createDropdownOpen">
                           <localize key="actions_create">Create</localize>
                           <span class="caret"></span>
                       </a>

                       <umb-dropdown ng-if="page.createDropdownOpen" on-close="page.createDropdownOpen = false">
                           <umb-dropdown-item ng-repeat="contentType in listViewAllowedTypes track by contentType.key | orderBy:'name':false">
                               <a ng-click="createBlank(entityType,contentType.alias)" prevent-default ng-href="">
                                   <i class="{{::contentType.icon}}"></i>
                                   {{::contentType.name}} <span ng-show="contentType.blueprints" style="text-transform: lowercase;">(<localize key="blueprints_blankBlueprint">blank</localize>)</span>
                               </a>
                               <a href="" ng-repeat="blueprint in contentType.blueprints | orderBy:'name':false" ng-click="createFromBlueprint(entityType, contentType.alias, blueprint.id)" prevent-default>
                                   &nbsp;&nbsp;<i class="{{::contentType.icon}}"></i>
                                   {{::blueprint.name}}
                               </a>
                           </umb-dropdown-item>
                       </umb-dropdown>
                   </div>

                   <ul class="umb-actions umb-actions-child">

                       <li ng-repeat="blueprint in docType.blueprints | orderBy:'name':false">
                           <a ng-click="createFromBlueprint(blueprint.id)">
                               <i class="large {{docType.icon}}"></i>
                               <span class="menu-label">
                                   {{blueprint.name}}
                               </span>
                           </a>
                       </li>

                       <li class="sep" ng-show="allowBlank">
                           <a ng-click="createBlank(docType)">
                               <i class="large {{docType.icon}}"></i>
                               <span class="menu-label">
                                   <localize key="blueprints_blankBlueprint">Blank</localize>
                               </span>
                           </a>
                       </li>

                   </ul>

               </umb-editor-sub-header-section>

               <umb-editor-sub-header-section ng-show="(selection.length > 0)">
                   <umb-button
                       type="button"
                       label="Clear selection"
                       label-key="buttons_clearSelection"
                       button-style="white"
                       action="clearSelection()"
                       disabled="actionInProgress">
                   </umb-button>
               </umb-editor-sub-header-section>

               <umb-editor-sub-header-section ng-show="(selection.length > 0)">
                   <strong ng-show="!actionInProgress">{{ selectedItemsCount() }} <localize key="general_of">of</localize> {{ listViewResultSet.items.length }} <localize key="general_selected">selected</localize></strong>
                   <strong ng-show="actionInProgress" ng-bind="bulkStatus"></strong>

                   <div class="umb-loader-wrapper -bottom" ng-show="actionInProgress">
                       <div class="umb-loader"></div>
                   </div>
               </umb-editor-sub-header-section>

           </umb-editor-sub-header-content-left>


           <umb-editor-sub-header-content-right>

               <umb-editor-sub-header-section ng-show="(selection.length == 0)">

                   <umb-layout-selector
                       ng-show="options.layout.layouts"
                       layouts="options.layout.layouts"
                       active-layout="options.layout.activeLayout"
                       on-layout-select="selectLayout(layout)">
                   </umb-layout-selector>

               </umb-editor-sub-header-section>

               <umb-editor-sub-header-section ng-show="(selection.length == 0)">
                   <ng-form class="form-search -no-margin-bottom pull-right" novalidate>
                       <div class="inner-addon left-addon">
                           <i class="icon icon-search" ng-click="enterSearch($event)"></i>
                           <input
                               class="form-control search-input"
                               type="text"
                               localize="placeholder"
                               placeholder="@general_typeToSearch"
                               ng-model="options.filter"
                               ng-change="enterSearch()"
                               ng-keydown="forceSearch($event)"
                               prevent-enter-submit
                               no-dirty-check>
                       </div>
                   </ng-form>
               </umb-editor-sub-header-section>

               <umb-editor-sub-header-section ng-show="(selection.length > 0)">

                   <umb-button
                       ng-if="options.allowBulkPublish && (buttonPermissions == null || buttonPermissions.canPublish)"
                       style="margin-right: 5px;"
                       type="button"
                       button-style="white"
                       label-key="actions_publish"
                       icon="icon-globe"
                       action="publish()"
                       disabled="actionInProgress"
                       size="xs"
                       add-ellipsis="true">
                   </umb-button>

                   <umb-button
                       ng-if="options.allowBulkUnpublish && (buttonPermissions == null || buttonPermissions.canUnpublish)"
                       style="margin-right: 5px;"
                       type="button"
                       button-style="white"
                       label-key="actions_unpublish"
                       icon="icon-block"
                       action="unpublish()"
                       disabled="actionInProgress"
                       size="xs"
                       add-ellipsis="true">
                   </umb-button>

                   <umb-button
                       ng-if="options.allowBulkCopy && (buttonPermissions == null || buttonPermissions.canCopy)"
                       style="margin-right: 5px;"
                       type="button"
                       button-style="white"
                       label-key="actions_copy"
                       icon="icon-documents"
                       action="copy()"
                       disabled="actionInProgress"
                       size="xs"
                       add-ellipsis="true">
                   </umb-button>

                   <umb-button
                       ng-if="options.allowBulkMove && (buttonPermissions == null || buttonPermissions.canMove)"
                       style="margin-right: 5px;"
                       type="button"
                       button-style="white"
                       label-key="actions_move"
                       icon="icon-enter"
                       action="move()"
                       disabled="actionInProgress"
                       size="xs"
                       add-ellipsis="true">
                   </umb-button>

                   <umb-button
                       ng-if="options.allowBulkDelete && (buttonPermissions == null || buttonPermissions.canDelete)"
                       type="button"
                       button-style="white"
                       label-key="actions_delete"
                       icon="icon-trash"
                       action="delete()"
                       disabled="actionInProgress"
                       size="xs"
                       add-ellipsis="true">
                   </umb-button>

               </umb-editor-sub-header-section>

           </umb-editor-sub-header-content-right>

       </umb-editor-sub-header>

       <umb-list-view-layout
         ng-if="viewLoaded"
         content-id="contentId"
         folders="folders"
         items="listViewResultSet.items"
         selection="selection"
         options="options"
         entity-type="{{entityType}}"
         on-get-content="getContent(contentId)">
      </umb-list-view-layout>

      <umb-load-indicator ng-show="!viewLoaded"></umb-load-indicator>

      <div class="flex justify-center">
          <umb-pagination
             ng-show="listViewResultSet.totalPages"
             page-number="options.pageNumber"
             total-pages="listViewResultSet.totalPages"
             on-next="next"
             on-prev="prev"
             on-go-to-page="goToPage">
          </umb-pagination>
      </div>

    </div>

    <umb-overlay
        ng-if="ysodOverlay.show"
        model="ysodOverlay"
        position="right"
        view="ysodOverlay.view">
    </umb-overlay>

</div>
