filter list by few facet checkboxes
[angular-drzb] / app / partials / list.html.ep
index b7f3989..2bfa179 100644 (file)
@@ -5,22 +5,45 @@ Loading data...
 
 <form ng-controller="ListCtrl" class="form-search" ng-show="ready">
 
+<div class="controls-row">
+
 <h2>Odaberite tip registracije</h2>
 
-<label class="radio input-block-level" ng-repeat="type in RegistrationTypes" ng-switch on="type.code">
+<label class="radio input-block-level" ng-repeat="type in RegistrationTypes" ng-switch on="type.code" ng-show="Counts[type.code] > 0">
 <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>
+
+<div class="controls-row">
+filters
+<label class="badge" ng-repeat="filter in filters">
+ <input ng-model="search[filter]" type="checkbox">
+ <span class="blob">{{Counts[filter]}}</span>
+ {{filter}}
+</label>
+
+</div>
+
 <div>
+
+<label>
 Search:
 <input class="search-query" ng-model="search.$">
-<a class="btn btn-invert" href="" ng-click="search.$ = ''">
+</label>
+
+<a class="btn btn-invert" href="" ng-click="search = {}">
 <i class="icon-remove"></i></a>
 <b>{{list.length}} results</b>
 <tt>{{search}}</tt>
@@ -33,57 +56,18 @@ Search:
 
 <ol>
 <li ng-repeat="registration in list">
- <a href="#/registration/{{registration.id}}">edit</a>
- {{registration.user.registration_type}}
- <tt>{{registration._id}}</tt>
-
-       <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>
-
-<p ng-show="registration.user.registration_type == 'symposium'">
-{{registration.symposium.title}}
- <p class="abstract">
- {{registration.symposium.abstract}}
- </p>
-</p>
-
-<h3 ng-show="registration.work.title">
-{{registration.work.title}}
-</h3>
-
-<p ng-repeat="author in registration.work.persons" >
- {{author.firstname}}
- {{author.surname}},
- <em>{{author.organization}}</em>
- <tt>&lt;{{author.email}}&gt;</tt>
-</p>
-
-<p class="abstract">{{registration.work.abstract}}</p>
-
-<ol ng-show="registration.user.registration_type == 'symposium'">
- <li ng-repeat="work in registration.work.symposium_works">
-  <h4>{{work.title}}</h4>
-
-       <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>
-
- </li>
+%= include 'registration/view'
+</li>
 
 </ol>
 
 </div><!-- ng-show="list.length"-->
 
+% if ( $lang =~ m/-dev/ ) {
+<pre class="controls-row">
+{{Counts}}
+</pre>
+% }
+
 </form>