<div class="umb-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">
        <div class="umb-sub-header">

            <div class="btn-group" ng-show="listViewAllowedTypes">
                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                    <localize key="actions_create">Create</localize>
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                    <li ng-repeat="contentType in listViewAllowedTypes">
                        <a
                            href="#/{{entityType}}/{{entityType}}/edit/{{contentId}}?doctype={{contentType.alias}}&create=true">
                            <i class="icon-{{contentType.cssClass}}"></i>
                            {{contentType.name}}
                        </a>
                    </li>
                </ul>
            </div>
            
            <div class="btn-group" ng-show="isAnythingSelected()" ng-if="entityType === 'content'">
                <a class="btn btn-success" ng-disabled="actionInProgress" ng-click="publish()" prevent-default>
                    <localize key="actions_publish">Publish</localize>
                </a>
            </div>
            <div class="btn-group" ng-show="isAnythingSelected()" ng-if="entityType === 'content'">
                <a class="btn btn-warning" ng-disabled="actionInProgress" ng-click="unpublish()" prevent-default>
                    <localize key="actions_unpublish">Unpublish</localize>
                </a>
            </div>
            <div class="btn-group" ng-show="isAnythingSelected()">
                <a class="btn btn-danger" ng-disabled="actionInProgress" ng-click="delete()" prevent-default>
                    <localize key="actions_delete">Delete</localize>
                </a>
            </div>
            <span ng-bind="bulkStatus" ng-show="isAnythingSelected()"></span>
        </div>

        <table class="table table-striped">
            <thead>
                <tr>
                    <td>
                        <input type="checkbox" ng-click="selectAll($event)" ng-checked="isSelectedAll()"></td>
                    <td><a href="#" ng-click="sort('Name')" prevent-default>
                        <localize key="general_name">Name</localize>
                        <i class="icon-sort"></i></a></td>
                    <td><a href="#" ng-click="sort('UpdateDate')" prevent-default>
                        <localize key="defaultdialogs_lastEdited">Last edited</localize>
                        <i class="icon-sort"></i></a></td>
                    <td><a href="#" ng-click="sort('Owner')" prevent-default>
                        <localize key="content_updatedBy">Updated by</localize>
                        <i class="icon-sort"></i></a></td>
                    <td>
                        <form class="pull-right" novalidate>
                            <i class="icon-search"></i>
                            <input type="text" ng-model="options.filter" on-keyup="search()">
                        </form>
                    </td>
                </tr>
            </thead>

            <tbody>
                <tr ng-repeat="result in listViewResultSet.items"
                    ng-class="{selected:result.selected}">

                    <td>
                        <i class="icon {{result.icon}}" ng-class="getIcon(result)"></i>

                        <input type="checkbox" ng-model="result.selected"></td>
                    <td>
                        <a ng-class="{inactive: entityType === 'content' && !result.published}" href="#/{{entityType}}/{{entityType}}/edit/{{result.id}}">{{result.name}}</a></td>
                    <td>{{result.updateDate|date:'medium'}} 
                        <!--<<span class="label label-success">Publish</span>-->
                    </td>
                    <td>{{result.owner.name}}
                        <!--<span class="label">Admin</span>-->
                    </td>
                    <td></td>
                </tr>
            </tbody>

            <tfoot ng-show="pagination.length > 1">
                <tr>
                    <th colspan="5">
                        <div class="pull-left">
                        </div>
                        <div class="pagination pagination-right">
                            <ul>
                                <li><a href="#" ng-click="prev()" prevent-default>
                                    <localize key="general_previous">Previous</localize>
                                </a></li>

                                <li ng-repeat="pgn in pagination track by $index"
                                    ng-class="{active:$index==options.offset}">
                                    <a href="#" ng-click="goToPage($index)" prevent-default>{{$index + 1}}</a>
                                </li>

                                <li><a href="#" ng-click="next()" prevent-default>
                                    <localize key="general_next">Next</localize>
                                </a></li>
                            </ul>
                        </div>

                    </th>
                </tr>
            </tfoot>
        </table>
    </div>
</div>