blob: 382dbeceb7b27bd65a76ae5f24cbdcb7f83283fe [file] [log] [blame]
Matteo Scandolo9f87f302016-12-13 18:11:10 -08001<!--<div ng-show="vm.data.length > 0 && vm.loader == false">-->
2 <div class="row" ng-if="vm.config.filter == 'fulltext'">
3 <div class="col-xs-12">
4 <input
5 class="form-control"
6 placeholder="Type to search.."
7 type="text"
8 ng-model="vm.query"/>
9 </div>
10 </div>
Matteo Scandolod62ea792016-12-22 14:02:28 -080011 <div class="table-responsive">
12 <table ng-class="vm.classes">
Matteo Scandolo9f87f302016-12-13 18:11:10 -080013 <thead>
14 <tr>
15 <th ng-repeat="col in vm.columns">
16 {{col.label}}
Matteo Scandolod62ea792016-12-22 14:02:28 -080017 <div ng-if="vm.config.order">
Matteo Scandolo9f87f302016-12-13 18:11:10 -080018 <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = false">
Matteo Scandolod58d5042016-12-16 16:59:21 -080019 <i class="fa fa-chevron-up"></i>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080020 </a>
21 <a href="" ng-click="vm.orderBy = col.prop; vm.reverse = true">
Matteo Scandolod58d5042016-12-16 16:59:21 -080022 <i class="fa fa-chevron-down"></i>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080023 </a>
Matteo Scandolod62ea792016-12-22 14:02:28 -080024 </div>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080025 </th>
26 <th ng-if="vm.config.actions">Actions:</th>
27 </tr>
28 </thead>
29 <tbody ng-if="vm.config.filter == 'field'">
Matteo Scandoloee655a12016-12-19 15:38:43 -080030 <tr>
31 <td ng-repeat="col in vm.columns">
32 <input
33 ng-if="col.type !== 'boolean' && col.type !== 'array' && col.type !== 'object' && col.type !== 'custom'"
34 class="form-control"
35 placeholder="Type to search by {{col.label}}"
36 type="text"
37 ng-model="vm.query[col.prop]"/>
38 <select
39 ng-if="col.type === 'boolean'"
40 class="form-control"
41 ng-model="vm.query[col.prop]">
42 <option value="">-</option>
43 <option value="true">True</option>
44 <option value="false">False</option>
45 </select>
46 </td>
47 <td ng-if="vm.config.actions"></td>
48 </tr>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080049 </tbody>
50 <tbody>
51 <tr ng-repeat="item in vm.data | filter:vm.query | orderBy:vm.orderBy:vm.reverse track by $index">
Matteo Scandoloee655a12016-12-19 15:38:43 -080052 <td ng-repeat="col in vm.columns" xos-link-wrapper>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080053 <span ng-if="!col.type || col.type === 'text'">{{item[col.prop]}}</span>
54 <span ng-if="col.type === 'boolean'">
Matteo Scandolod58d5042016-12-16 16:59:21 -080055 <i class="fa"
56 ng-class="{'fa-ok': item[col.prop], 'fa-remove': !item[col.prop]}">
Matteo Scandolo9f87f302016-12-13 18:11:10 -080057 </i>
58 </span>
59 <span ng-if="col.type === 'date'">
60 {{item[col.prop] | date:'H:mm MMM d, yyyy'}}
61 </span>
62 <span ng-if="col.type === 'array'">
63 {{item[col.prop] | arrayToList}}
64 </span>
65 <span ng-if="col.type === 'object'">
66 <dl class="dl-horizontal">
67 <span ng-repeat="(k,v) in item[col.prop]">
68 <dt>{{k}}</dt>
69 <dd>{{v}}</dd>
70 </span>
71 </dl>
72 </span>
73 <span ng-if="col.type === 'custom'">
74 {{col.formatter(item)}}
75 </span>
76 <span ng-if="col.type === 'icon'">
Matteo Scandolod58d5042016-12-16 16:59:21 -080077 <i class="fa fa-{{col.formatter(item)}}">
Matteo Scandolo9f87f302016-12-13 18:11:10 -080078 </i>
79 </span>
80 </td>
81 <td ng-if="vm.config.actions">
82 <a href=""
83 ng-repeat="action in vm.config.actions"
84 ng-click="action.cb(item)"
85 title="{{action.label}}">
86 <i
Matteo Scandolod58d5042016-12-16 16:59:21 -080087 class="fa fa-{{action.icon}}"
Matteo Scandolo9f87f302016-12-13 18:11:10 -080088 style="color: {{action.color}};"></i>
89 </a>
90 </td>
91 </tr>
92 </tbody>
93 </table>
Matteo Scandolod62ea792016-12-22 14:02:28 -080094 </div>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080095<!--</div>-->
96<!--<div ng-show="(vm.data.length == 0 || !vm.data) && vm.loader == false">-->
97 <!--<xos-alert config="{type: 'info'}">-->
98 <!--No data to show.-->
99 <!--</xos-alert>-->
100<!--</div>-->
101<!--<div ng-show="vm.loader == true">-->
102 <!--<div class="loader"></div>-->
103<!--</div>-->