hide pagination if showing all results
[angular-drzb] / app / partials / list.html.ep
index 7fbbb32..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>
+
+<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 ng-show="RegistrationTypeCount[type.code] > 0">
- <tt>{{RegistrationTypeCount[type.code]}}</tt>
+<span ng-switch-default>
+ <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.$ = ''">
-<i class="icon-remove"></i></a>
-<b>{{list.length}} results</b>
-<tt>{{search}}</tt>
-</div>
+</fieldset>
+
+<fieldset ng-show="show.filters">
+<legend>
+Filters
+</legend>
 
-<div ng-show="list.length">
+<label class="badge filter-{{search[filter]}}" ng-repeat="filter in filters">
+ <input ng-model="search[filter]" type="checkbox">
+ {{Counts[filter]}}
+ {{filter}}
+</label>
 
-<h2>Prijavljenje registracije {{search.registration_type}}</h2>
+</fieldset>
 
+<fieldset>
+<legend>
+Search
+</legend>
 
-<ol>
-<li ng-repeat="registration in list">
- <a href="#/registration/{{registration.id}}">edit</a>
- {{registration.user.registration_type}}
- <tt>{{registration._id}}</tt>
- {{registration._id | registration_timestamp}}
+<input class="my-lebel-input search-query" ng-model="search.$" label="Search">
 
-       <p>
-        {{registration.user.firstname}}
-        {{registration.user.surname}}
-        <em>{{registration.user.organization}}</em>,
-        {{registration.user.city}},
-        <i>{{registration.user.country}}</i>
-        <tt>&lt;{{registration.user.email}}&gt;</tt>
-       </p>
+<a class="btn btn-invert" href="" ng-click="reset()">
+<i class="icon-remove"></i></a>
 
-<p ng-show="registration.user.registration_type == 'symposium'">
-{{registration.symposium.title}}
- <p class="abstract">
- {{registration.symposium.abstract}}
- </p>
-</p>
+<b>{{pager.results}} results</b>
+<tt>{{search}}</tt>
 
-<h3 ng-show="registration.work.title">
-{{registration.work.title}}
-</h3>
+<label>
+<input type="checkbox" ng-model="pager.show_all">
+All results on single page <b>(can be slow!)</b>
+</label>
 
-<p ng-repeat="author in registration.work.persons" >
- {{author.firstname}}
- {{author.surname}},
- <em>{{author.organization}}</em>
- <tt>&lt;{{author.email}}&gt;</tt>
-</p>
+</fieldset>
 
-<p class="abstract">{{registration.work.abstract}}</p>
+<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>
 
-<ol ng-show="registration.user.registration_type == 'symposium'">
- <li ng-repeat="work in registration.work.symposium_works">
-  <h4>{{work.title}}</h4>
+<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>
 
-       <p ng-repeat="author in work.persons" >
-        {{author.firstname}}
-        {{author.surname}},
-        <em>{{author.organization}}</em>
-        <tt>&lt;{{author.email}}&gt;</tt>
-       </p>
 
-    <p class="abstract">{{work.abstract}}</p>
+<div ng-show="list.length" class="content">
 
- </li>
+<pagination class="pagination-large" max-size="12"
+       num-pages="pager.last_page"
+       current-page="pager.page"
+       hide-pagination="pager.show_all"
+></pagination>
 
-</ol>
+<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>