blob: 788e84c9fca786899d1be1d8d8fb37d7420995a2 [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'">
Matteo Scandolo04964232017-01-07 12:53:46 -080074 {{item[col.prop + '-formatted']}}
75 <i class="ng-hide">{{col.formatter(item)}}</i>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080076 </span>
77 <span ng-if="col.type === 'icon'">
Matteo Scandolod58d5042016-12-16 16:59:21 -080078 <i class="fa fa-{{col.formatter(item)}}">
Matteo Scandolo9f87f302016-12-13 18:11:10 -080079 </i>
80 </span>
81 </td>
82 <td ng-if="vm.config.actions">
83 <a href=""
84 ng-repeat="action in vm.config.actions"
85 ng-click="action.cb(item)"
86 title="{{action.label}}">
87 <i
Matteo Scandolod58d5042016-12-16 16:59:21 -080088 class="fa fa-{{action.icon}}"
Matteo Scandolo9f87f302016-12-13 18:11:10 -080089 style="color: {{action.color}};"></i>
90 </a>
91 </td>
92 </tr>
93 </tbody>
94 </table>
Matteo Scandolod62ea792016-12-22 14:02:28 -080095 </div>
Matteo Scandolo9f87f302016-12-13 18:11:10 -080096<!--</div>-->
97<!--<div ng-show="(vm.data.length == 0 || !vm.data) && vm.loader == false">-->
98 <!--<xos-alert config="{type: 'info'}">-->
99 <!--No data to show.-->
100 <!--</xos-alert>-->
101<!--</div>-->
102<!--<div ng-show="vm.loader == true">-->
103 <!--<div class="loader"></div>-->
104<!--</div>-->