|  | @@ -0,0 +1,114 @@
 | 
		
	
		
			
			|  | 1 | +<div layout="column" layout-fill layout-align="top" angular-busy="appUtils.cgBusy(itemType + '.table')">
 | 
		
	
		
			
			|  | 2 | +
 | 
		
	
		
			
			|  | 3 | +    <div flex>
 | 
		
	
		
			
			|  | 4 | +        <md-toolbar class="md-table-toolbar md-default" ng-show="isModal || (!isFilterShown && selected.length == 0)">
 | 
		
	
		
			
			|  | 5 | +            <div class="md-toolbar-tools">
 | 
		
	
		
			
			|  | 6 | +                <span>{{ itemType + '.name' | translate }}</span>
 | 
		
	
		
			
			|  | 7 | +                <span flex></span>
 | 
		
	
		
			
			|  | 8 | +                <md-button ng-show="isModal && items != null" class="md-icon-button" ng-click="addItemDialog()" title="{{ 'common.new' | translate }}">
 | 
		
	
		
			
			|  | 9 | +                    <md-icon class="material-icons">add</md-icon>
 | 
		
	
		
			
			|  | 10 | +                </md-button>
 | 
		
	
		
			
			|  | 11 | +                <md-button ng-show="!isModal" class="md-icon-button" ui-sref="{{itemType}}_add" title="{{ 'common.new' | translate }}">
 | 
		
	
		
			
			|  | 12 | +                    <md-icon class="material-icons">add</md-icon>
 | 
		
	
		
			
			|  | 13 | +                </md-button>
 | 
		
	
		
			
			|  | 14 | +                <md-button ng-show="!isModal" class="md-icon-button" ng-click="showFilter(true)" title="{{ 'common.filter' | translate }}">
 | 
		
	
		
			
			|  | 15 | +                    <md-icon class="material-icons">search</md-icon>
 | 
		
	
		
			
			|  | 16 | +                </md-button>
 | 
		
	
		
			
			|  | 17 | +                <md-button ng-show="!isModal" class="md-icon-button" ng-click="getItems()" title="{{ 'common.refresh' | translate }}">
 | 
		
	
		
			
			|  | 18 | +                    <md-icon class="material-icons">refresh</md-icon>
 | 
		
	
		
			
			|  | 19 | +                </md-button>
 | 
		
	
		
			
			|  | 20 | +            </div>
 | 
		
	
		
			
			|  | 21 | +        </md-toolbar>
 | 
		
	
		
			
			|  | 22 | +        <md-toolbar class="md-table-toolbar md-default" ng-show="isModal || (isFilterShown && selected.length == 0)">
 | 
		
	
		
			
			|  | 23 | +            <div class="md-toolbar-tools">
 | 
		
	
		
			
			|  | 24 | +                <md-icon class="material-icons">search</md-icon>
 | 
		
	
		
			
			|  | 25 | +                <form autocomplete="off">
 | 
		
	
		
			
			|  | 26 | +                    <md-input-container class="md-block" flex-gt-sm>
 | 
		
	
		
			
			|  | 27 | +                        <label>{{ 'common.filter' | translate }}</label>
 | 
		
	
		
			
			|  | 28 | +                        <input type="text" ng-model="query.filter" ng-model-options="{debounce: 500}" ng-change="getItems()">
 | 
		
	
		
			
			|  | 29 | +                    </md-input-container>
 | 
		
	
		
			
			|  | 30 | +
 | 
		
	
		
			
			|  | 31 | +                </form>
 | 
		
	
		
			
			|  | 32 | +                <md-button ng-show="!isModal" class="md-icon-button" ng-click="showFilter(false)" title="{{ 'common.close' | translate }}">
 | 
		
	
		
			
			|  | 33 | +                    <md-icon class="material-icons">close</md-icon>
 | 
		
	
		
			
			|  | 34 | +                </md-button>
 | 
		
	
		
			
			|  | 35 | +                <md-button class="md-icon-button" ng-click="getItems()" title="{{ 'common.refresh' | translate }}">
 | 
		
	
		
			
			|  | 36 | +                    <md-icon class="material-icons">refresh</md-icon>
 | 
		
	
		
			
			|  | 37 | +                </md-button>
 | 
		
	
		
			
			|  | 38 | +            </div>
 | 
		
	
		
			
			|  | 39 | +        </md-toolbar>
 | 
		
	
		
			
			|  | 40 | +        <md-toolbar class="md-table-toolbar alternate" ng-show="selected.length > 0">
 | 
		
	
		
			
			|  | 41 | +            <div class="md-toolbar-tools">
 | 
		
	
		
			
			|  | 42 | +                <span>{{ itemType + '.selectedItems' | translate:{count:selected.length} }}</span>
 | 
		
	
		
			
			|  | 43 | +                <span flex></span>
 | 
		
	
		
			
			|  | 44 | +                <md-button class="md-icon-button" ng-click="askRemoveSelected()" title="{{ 'common.delete' | translate }}">
 | 
		
	
		
			
			|  | 45 | +                    <md-icon class="material-icons">delete</md-icon>
 | 
		
	
		
			
			|  | 46 | +                </md-button>
 | 
		
	
		
			
			|  | 47 | +            </div>
 | 
		
	
		
			
			|  | 48 | +        </md-toolbar>
 | 
		
	
		
			
			|  | 49 | +    </div>
 | 
		
	
		
			
			|  | 50 | +
 | 
		
	
		
			
			|  | 51 | +    <div flex>
 | 
		
	
		
			
			|  | 52 | +        <md-table-container>
 | 
		
	
		
			
			|  | 53 | +            <table md-table md-row-select multiple ng-model="selected" >
 | 
		
	
		
			
			|  | 54 | +                <thead md-head md-order="query.order" md-on-reorder="getItems">
 | 
		
	
		
			
			|  | 55 | +                <tr md-row>
 | 
		
	
		
			
			|  | 56 | +                    <th md-column md-order-by="id"><span>{{ itemType + '.title' | translate }}</span></th>
 | 
		
	
		
			
			|  | 57 | +                    <th md-column md-order-by="type"><span>{{ itemType + '.type' | translate }}</span></th>
 | 
		
	
		
			
			|  | 58 | +                    <th md-column md-order-by="createdAt">{{ 'common.createdAt' | translate }}</th>
 | 
		
	
		
			
			|  | 59 | +                    <th md-column md-order-by="updatedAt">{{ 'common.updatedAt' | translate }}</th>
 | 
		
	
		
			
			|  | 60 | +                    <th class="col-icon-1" md-column>{{ 'common.actions' | translate }}</th>
 | 
		
	
		
			
			|  | 61 | +                </tr>
 | 
		
	
		
			
			|  | 62 | +                </thead>
 | 
		
	
		
			
			|  | 63 | +                <tbody md-body>
 | 
		
	
		
			
			|  | 64 | +                <tr md-row md-select="item" md-select-id="id" ng-repeat="item in items.data">
 | 
		
	
		
			
			|  | 65 | +                    <td md-cell>{{item.title}}</td>
 | 
		
	
		
			
			|  | 66 | +                    <td md-cell>{{ itemType + '.types.' + item.type | translate }}</td>
 | 
		
	
		
			
			|  | 67 | +                    <td md-cell>{{item.createdAt | formatDateTime}}</td>
 | 
		
	
		
			
			|  | 68 | +                    <td md-cell>{{item.updatedAt == null ? ('common.never' | translate ) : (item.updatedAt | formatDateTime)}}</td>
 | 
		
	
		
			
			|  | 69 | +                    <td class="col-icon-1" md-cell>
 | 
		
	
		
			
			|  | 70 | +                        <md-menu ng-show="!isModal">
 | 
		
	
		
			
			|  | 71 | +                            <md-button class="md-icon-button" ng-click="$mdOpenMenu($event)">
 | 
		
	
		
			
			|  | 72 | +                                <md-icon class="material-icons">more_vert</md-icon>
 | 
		
	
		
			
			|  | 73 | +                            </md-button>
 | 
		
	
		
			
			|  | 74 | +                            <md-menu-content>
 | 
		
	
		
			
			|  | 75 | +                                <md-menu-item>
 | 
		
	
		
			
			|  | 76 | +                                    <md-button ui-sref="{{itemType}}_edit({id: item.id, item: item})">
 | 
		
	
		
			
			|  | 77 | +                                        <md-icon class="material-icons">mode_edit</md-icon>
 | 
		
	
		
			
			|  | 78 | +                                        {{ 'common.edit' | translate }}
 | 
		
	
		
			
			|  | 79 | +                                    </md-button>
 | 
		
	
		
			
			|  | 80 | +                                </md-menu-item>
 | 
		
	
		
			
			|  | 81 | +                                <md-menu-item>
 | 
		
	
		
			
			|  | 82 | +                                    <md-button ng-click="editItem(item)">
 | 
		
	
		
			
			|  | 83 | +                                        <md-icon class="material-icons">border_color</md-icon>
 | 
		
	
		
			
			|  | 84 | +                                        {{ 'common.editDialog' | translate }}
 | 
		
	
		
			
			|  | 85 | +                                    </md-button>
 | 
		
	
		
			
			|  | 86 | +                                </md-menu-item>
 | 
		
	
		
			
			|  | 87 | +                                <md-menu-divider></md-menu-divider>
 | 
		
	
		
			
			|  | 88 | +                                <md-menu-item>
 | 
		
	
		
			
			|  | 89 | +                                    <md-button ng-click="askRemoveOne(item)">
 | 
		
	
		
			
			|  | 90 | +                                        <md-icon class="material-icons">delete</md-icon>
 | 
		
	
		
			
			|  | 91 | +                                        {{ 'common.delete' | translate }}
 | 
		
	
		
			
			|  | 92 | +                                    </md-button>
 | 
		
	
		
			
			|  | 93 | +                                </md-menu-item>
 | 
		
	
		
			
			|  | 94 | +                            </md-menu-content>
 | 
		
	
		
			
			|  | 95 | +                        </md-menu>
 | 
		
	
		
			
			|  | 96 | +
 | 
		
	
		
			
			|  | 97 | +                        <md-button ng-show="isModal" class="md-icon-button" ng-click="selectItem(item)" title="{{ 'common.select' | translate }}">
 | 
		
	
		
			
			|  | 98 | +                            <md-icon class="material-icons">done</md-icon>
 | 
		
	
		
			
			|  | 99 | +                        </md-button>
 | 
		
	
		
			
			|  | 100 | +                    </td>
 | 
		
	
		
			
			|  | 101 | +                </tr>
 | 
		
	
		
			
			|  | 102 | +                </tbody>
 | 
		
	
		
			
			|  | 103 | +            </table>
 | 
		
	
		
			
			|  | 104 | +        </md-table-container>
 | 
		
	
		
			
			|  | 105 | +    </div>
 | 
		
	
		
			
			|  | 106 | +
 | 
		
	
		
			
			|  | 107 | +    <md-table-pagination md-label="{{appUtils.mdTableLabels()}}" class="col-xs-11" md-limit="query.limit" md-limit-options="[5, 10, 20]"
 | 
		
	
		
			
			|  | 108 | +                         md-page="query.page" md-total="{{items.count}}" md-on-paginate="getItems" md-page-select></md-table-pagination>
 | 
		
	
		
			
			|  | 109 | +
 | 
		
	
		
			
			|  | 110 | +    <div ng-repeat="error in busy.errors(itemType + '.table')" class="isa_error">
 | 
		
	
		
			
			|  | 111 | +        <i class="fa fa-times-circle"></i>
 | 
		
	
		
			
			|  | 112 | +        {{ error.data.message }}
 | 
		
	
		
			
			|  | 113 | +    </div>
 | 
		
	
		
			
			|  | 114 | +</div>
 |