3 angular.module('dashboardApp')
4 .controller('SeguiciCtrl', function($scope, $http, datepickerPopupConfig, $stateParams) {
7 $scope.limit = baseLimit;
10 $scope.dataInizio = new Date(d);
15 $scope.loadShows = function() {
16 route = '/api/shows?limit=' + $scope.limit;
17 if ($scope.dataInizio) {
18 route += '&date=' + $scope.dataInizio;
20 if ($scope.category) {
21 route += '&category=' + $scope.category;
23 if ($stateParams.lat && $stateParams.lng) {
24 route += '&lat=' + $stateParams.lat + '&lng=' + $stateParams.lng;
26 if ($scope.fulltext) {
27 route += '&fulltext=' + $scope.fulltext;
29 $http.get(route).then(function(response) {
30 $scope.posters = response.data;
31 $scope.limit += $scope.limit;
32 if ($scope.loadCount % 2 === 0) {
42 $scope.pCount = function(index) {
43 posterCount = index % 10 === 0 ? 0 : posterCount + 1;
44 return posterCount === 0 || posterCount === 6;
47 $scope.datepickers = {
52 $scope.open = function($event, which, whichnot) {
53 $event.preventDefault();
54 $event.stopPropagation();
56 $scope.datepickers[which]= true;
57 $scope.datepickers[whichnot]= false;
60 $scope.dateOptions = {
66 datepickerPopupConfig.showButtonBar = false;
67 datepickerPopupConfig.appendToBody = false;
69 $scope.minDate = new Date();
70 $scope.minDateFine = new Date();
72 $scope.searchShows = function() {
73 $scope.limit = baseLimit;
79 $http.get('/api/categories?active=true').then(function(response) {
80 $scope.categories = response.data;