mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-07 03:36:44 +01:00
getEvents by following users, and some pages
This commit is contained in:
@@ -24,7 +24,10 @@ angular.module('app', [
|
||||
'app.user',
|
||||
'app.login',
|
||||
'app.userZone',
|
||||
'app.newEvent'
|
||||
'app.newEvent',
|
||||
'app.editUser',
|
||||
'app.statistics',
|
||||
'app.newAlert'
|
||||
])
|
||||
|
||||
.run(function($ionicPlatform) {
|
||||
@@ -206,6 +209,33 @@ angular.module('app', [
|
||||
controller: 'NewEventCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.editUser', {
|
||||
url: '/editUser',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/editUser.html',
|
||||
controller: 'EditUserCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.statistics', {
|
||||
url: '/statistics',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/statistics.html',
|
||||
controller: 'StatisticsCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.newAlert', {
|
||||
url: '/newAlert',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/newAlert.html',
|
||||
controller: 'NewAlertCtrl'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// if none of the above states are matched, use this as the fallback
|
||||
|
||||
@@ -6,4 +6,16 @@ angular.module('app.calendar', ['pascalprecht.translate'])
|
||||
$scope.dayClick = function(date) {
|
||||
window.location="#/app/byDay/" + date;
|
||||
};
|
||||
|
||||
var startOfWeek = moment().startOf('month');
|
||||
var endOfWeek = moment().endOf('month');
|
||||
$scope.days = [];
|
||||
var day = startOfWeek;
|
||||
|
||||
while (day <= endOfWeek) {
|
||||
$scope.days.push(new Date(day.toDate()));
|
||||
day = day.clone().add(1, 'd');
|
||||
}
|
||||
|
||||
console.log($scope.days);
|
||||
});
|
||||
|
||||
8
www/js/editUser.js
Normal file
8
www/js/editUser.js
Normal file
@@ -0,0 +1,8 @@
|
||||
angular.module('app.editUser', ['pascalprecht.translate'])
|
||||
|
||||
.controller('EditUserCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -7,10 +7,17 @@ angular.module('app.events', ['pascalprecht.translate'])
|
||||
$scope.events=[];
|
||||
$scope.alerts=[];
|
||||
$scope.page=0;
|
||||
|
||||
$scope.doRefresh = function() {
|
||||
/* events refresh: */
|
||||
//$http.get(urlapi + 'events?page=' + $scope.page)
|
||||
$http.get(urlapi + 'events')
|
||||
$scope.followingUsers = JSON.parse(localStorage.getItem("events_app_followingUsers"));
|
||||
console.log($scope.followingUsers);
|
||||
$http({
|
||||
url: urlapi + 'events/following',
|
||||
method: "POST",
|
||||
data: {users: $scope.followingUsers}
|
||||
})
|
||||
.then(function(data){
|
||||
console.log('data success events');
|
||||
console.log(data); // for browser console
|
||||
|
||||
8
www/js/newAlert.js
Normal file
8
www/js/newAlert.js
Normal file
@@ -0,0 +1,8 @@
|
||||
angular.module('app.newAlert', ['pascalprecht.translate'])
|
||||
|
||||
.controller('NewAlertCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
8
www/js/statistics.js
Normal file
8
www/js/statistics.js
Normal file
@@ -0,0 +1,8 @@
|
||||
angular.module('app.statistics', ['pascalprecht.translate'])
|
||||
|
||||
.controller('StatisticsCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -33,12 +33,12 @@ angular.module('app.users', ['pascalprecht.translate'])
|
||||
}
|
||||
});
|
||||
$scope.followUser = function(user){
|
||||
$scope.followingUsers.push(user);
|
||||
$scope.followingUsers.push(user._id);
|
||||
localStorage.setItem("events_app_followingUsers", JSON.stringify($scope.followingUsers));
|
||||
};
|
||||
$scope.unfollowUser = function(user){
|
||||
for(var i=0; i<$scope.followingUsers.length; i++) {
|
||||
if ($scope.followingUsers[i]._id === user._id){
|
||||
if ($scope.followingUsers[i] === user._id){
|
||||
$scope.followingUsers.splice(i, 1);
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ angular.module('app.users', ['pascalprecht.translate'])
|
||||
};
|
||||
$scope.isUserFollowed = function(user) {
|
||||
for(var i=0; i<$scope.followingUsers.length; i++) {
|
||||
if ($scope.followingUsers[i]._id === user._id){
|
||||
if ($scope.followingUsers[i] === user._id){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user