count registration states
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 25 Jan 2013 13:42:24 +0000 (14:42 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 25 Jan 2013 13:42:24 +0000 (14:42 +0100)
app/js/controllers.js
app/partials/list.html.ep

index 6846bb7..33bafe3 100644 (file)
@@ -219,6 +219,9 @@ function ListCtrl($scope, $log, Registration, RegistrationTypes, $filter, Regist
                                value[f] = v == true || v == 'yes' ? true : false;
                        });
 
+                       // count registration state
+                       inc_count( 'state+' + value.state );
+
 //                     $log.info( key, value, Counts[type]  );
                });
                $log.info('Counts', Counts);
index 59a07d8..8971734 100644 (file)
@@ -58,6 +58,7 @@ Search
 
 <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>