filters now accept arbitrary select and have label
[angular-drzb] / app / partials / list.html.ep
1
2 <div ng-show="! ready" class="alert alert-important">
3 Loading data...
4 </div>
5
6 <form ng-controller="ListCtrl" class="form-search" ng-show="ready">
7
8
9 <fieldset ng-show="show.registration_type">
10 <legend>
11 Odaberite tip registracije
12 </legend>
13
14 <label class="radio input-block-level" ng-repeat="type in RegistrationTypes" ng-switch on="type.code">
15 <hr ng-switch-when="false">
16 <span ng-switch-default>
17  <span class="badge {{type.css_class}}">{{Counts[type.code]}}</span>
18  <input type="radio" name="search.registration_type" ng-model="search.registration_type" value="{{type.code}}" >
19  {{type.label}}
20 <!--
21  <i>{{type.description}}</i>
22 -->
23  <span class="badge" ng-repeat="filter in filters" ng-show="Counts[type.code+'+'+filter.name]"+>
24         {{Counts[type.code+'+'+filter.name]}} {{filter.label}}
25  </span>
26 </span>
27 </label>
28
29 </fieldset>
30
31 <fieldset ng-show="show.filters">
32 <legend>
33 Filters
34 </legend>
35
36 <label class="badge filter-{{search[filter.name]}}" ng-repeat="filter in filters" >
37  <input ng-model="search[filter.name]" type="checkbox">
38  {{Counts[filter.name]}}
39  {{filter.label}}
40 </label>
41
42 </fieldset>
43
44 <fieldset>
45 <legend>
46 Search
47 </legend>
48
49 <input class="my-lebel-input search-query" ng-model="search.$" label="Search">
50
51 <a class="btn btn-invert" href="" ng-click="reset()">
52 <i class="icon-remove"></i></a>
53
54 <b>{{pager.results}} results</b>
55 <tt>{{search}}</tt>
56
57 <label>
58 <input type="checkbox" ng-model="pager.show_all">
59 All results on single page <b>(can be slow!)</b>
60 </label>
61
62 </fieldset>
63
64 <fieldset ng-show="show.states">
65 <button ng-repeat="state in ValidStates" ng-click="search.$ = state" class="btn {{state}}">
66 <span class="badge">{{Counts['state+'+state]}}</span>
67 {{state}}
68 </button>
69 </fieldset>
70
71 <fieldset ng-show="show.pager_numeric">
72 <input type="number" ng-model="pager.page" size="3" min="1" max="{{pager.last_page}}">
73 <input type="number" ng-model="pager.limit">
74 </fieldset>
75
76
77 <div ng-show="list.length" class="content">
78
79 <pagination class="pagination-large" max-size="12"
80         num-pages="pager.last_page"
81         current-page="pager.page"
82         hide-pagination="pager.show_all"
83 ></pagination>
84
85 <dl ng-repeat="registration in list">
86 %= include 'registration/view', before => begin
87 {{registration.nr}}
88 <a class="btn btn-primary" href="#/verified/{{registration.id}}">change status</a>
89 % end
90 </dl>
91
92 <pagination class="pagination-large" max-size="12"
93         num-pages="pager.last_page"
94         current-page="pager.page"
95         hide-pagination="pager.show_all"
96 ></pagination>
97
98 </div><!-- ng-show="list.length"-->
99
100 % if ( $lang =~ m/-dev/ ) {
101 <pre class="controls-row">
102 {{pager}}
103
104 {{Counts}}
105 </pre>
106 % }
107
108 </form>
109