hide pagination if showing all results
[angular-drzb] / app / partials / list.html.ep
index 06c259a..0faca67 100644 (file)
-<div ng-show="! ready">
+
+<div ng-show="! ready" class="alert alert-important">
 Loading data...
 </div>
 
-
 <form ng-controller="ListCtrl" class="form-search" ng-show="ready">
 
-<h2>Odaberite tip registracije</h2>
 
-<label class="radio input-block-level" ng-repeat="type in RegistrationTypes" ng-switch on="type.code" ng-show="RegistrationTypeCount[type.code] > 0">
+<fieldset ng-show="show.registration_type">
+<legend>
+Odaberite tip registracije
+</legend>
+
+<label class="radio input-block-level" ng-repeat="type in RegistrationTypes" ng-switch on="type.code">
 <hr ng-switch-when="false">
 <span ng-switch-default>
- <tt>{{RegistrationTypeCount[type.code]}}</tt>
+ <span class="badge {{type.css_class}}">{{Counts[type.code]}}</span>
  <input type="radio" name="search.registration_type" ng-model="search.registration_type" value="{{type.code}}" >
  {{type.label}}
 <!--
  <i>{{type.description}}</i>
 -->
+ <span class="badge" ng-repeat="subtype in filters" ng-show="Counts[type.code+'+'+subtype]"+>
+       {{Counts[type.code+'+'+subtype]}} {{subtype}}
+ </span>
 </span>
 </label>
 
-<div>
-Search:
-<input class="search-query" ng-model="search.$">
-<a class="btn btn-invert" href="" ng-click="search.$ = ''">
+</fieldset>
+
+<fieldset ng-show="show.filters">
+<legend>
+Filters
+</legend>
+
+<label class="badge filter-{{search[filter]}}" ng-repeat="filter in filters">
+ <input ng-model="search[filter]" type="checkbox">
+ {{Counts[filter]}}
+ {{filter}}
+</label>
+
+</fieldset>
+
+<fieldset>
+<legend>
+Search
+</legend>
+
+<input class="my-lebel-input search-query" ng-model="search.$" label="Search">
+
+<a class="btn btn-invert" href="" ng-click="reset()">
 <i class="icon-remove"></i></a>
-<b>{{list.length}} results</b>
+
+<b>{{pager.results}} results</b>
 <tt>{{search}}</tt>
-</div>
 
-<div ng-show="list.length">
+<label>
+<input type="checkbox" ng-model="pager.show_all">
+All results on single page <b>(can be slow!)</b>
+</label>
+
+</fieldset>
+
+<fieldset ng-show="show.states">
+<button ng-repeat="state in RegistrationState" ng-click="search.$ = state" class="btn {{state}}">
+<span class="badge">{{Counts['state+'+state]}}</span>
+{{state}}
+</button>
+</fieldset>
 
-<h2>Prijavljenje registracije {{search.registration_type}}</h2>
+<fieldset ng-show="show.pager_numeric">
+<input type="number" ng-model="pager.page" size="3" min="1" max="{{pager.last_page}}">
+<input type="number" ng-model="pager.limit">
+</fieldset>
 
 
-<ol>
-<li ng-repeat="registration in list">
-%= include 'registration/view'
-</li>
+<div ng-show="list.length" class="content">
 
-</ol>
+<pagination class="pagination-large" max-size="12"
+       num-pages="pager.last_page"
+       current-page="pager.page"
+       hide-pagination="pager.show_all"
+></pagination>
+
+<dl ng-repeat="registration in list">
+%= include 'registration/view', before => begin
+{{registration.nr}}
+<a class="btn btn-primary" href="#/verified/{{registration.id}}">change status</a>
+% end
+</dl>
+
+<pagination class="pagination-large" max-size="12"
+       num-pages="pager.last_page"
+       current-page="pager.page"
+       hide-pagination="pager.show_all"
+></pagination>
 
 </div><!-- ng-show="list.length"-->
 
+% if ( $lang =~ m/-dev/ ) {
+<pre class="controls-row">
+{{pager}}
+
+{{Counts}}
+</pre>
+% }
+
 </form>