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:
@@ -8,6 +8,6 @@
|
|||||||
"angular-translate": "^2.14.0",
|
"angular-translate": "^2.14.0",
|
||||||
"ui-leaflet": "^2.0.0",
|
"ui-leaflet": "^2.0.0",
|
||||||
"ngCordova": "^0.1.27-alpha",
|
"ngCordova": "^0.1.27-alpha",
|
||||||
"material-calendar": "^0.2.14"
|
"moment": "^2.17.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
<link href="css/style.css" rel="stylesheet">
|
<link href="css/style.css" rel="stylesheet">
|
||||||
<link href="css/colors.css" rel="stylesheet">
|
<link href="css/colors.css" rel="stylesheet">
|
||||||
|
|
||||||
<link rel="stylesheet" href="lib/angular-material/angular-material.css">
|
|
||||||
|
|
||||||
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
|
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
|
||||||
<link href="css/ionic.app.css" rel="stylesheet">
|
<link href="css/ionic.app.css" rel="stylesheet">
|
||||||
-->
|
-->
|
||||||
@@ -44,6 +42,9 @@
|
|||||||
<script src="lib/angular-translate/angular-translate.js"></script>
|
<script src="lib/angular-translate/angular-translate.js"></script>
|
||||||
<script src="js/translations.js"></script>
|
<script src="js/translations.js"></script>
|
||||||
|
|
||||||
|
<!-- momentjs -->
|
||||||
|
<script src="lib/moment/moment.js"></script>
|
||||||
|
|
||||||
<!-- your app's js -->
|
<!-- your app's js -->
|
||||||
<script src="js/app.js"></script>
|
<script src="js/app.js"></script>
|
||||||
<script src="js/menu.js"></script>
|
<script src="js/menu.js"></script>
|
||||||
@@ -64,6 +65,9 @@
|
|||||||
<script src="js/login.js"></script>
|
<script src="js/login.js"></script>
|
||||||
<script src="js/userZone.js"></script>
|
<script src="js/userZone.js"></script>
|
||||||
<script src="js/newEvent.js"></script>
|
<script src="js/newEvent.js"></script>
|
||||||
|
<script src="js/editUser.js"></script>
|
||||||
|
<script src="js/statistics.js"></script>
|
||||||
|
<script src="js/newAlert.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ angular.module('app', [
|
|||||||
'app.user',
|
'app.user',
|
||||||
'app.login',
|
'app.login',
|
||||||
'app.userZone',
|
'app.userZone',
|
||||||
'app.newEvent'
|
'app.newEvent',
|
||||||
|
'app.editUser',
|
||||||
|
'app.statistics',
|
||||||
|
'app.newAlert'
|
||||||
])
|
])
|
||||||
|
|
||||||
.run(function($ionicPlatform) {
|
.run(function($ionicPlatform) {
|
||||||
@@ -206,6 +209,33 @@ angular.module('app', [
|
|||||||
controller: 'NewEventCtrl'
|
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
|
// 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) {
|
$scope.dayClick = function(date) {
|
||||||
window.location="#/app/byDay/" + 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.events=[];
|
||||||
$scope.alerts=[];
|
$scope.alerts=[];
|
||||||
$scope.page=0;
|
$scope.page=0;
|
||||||
|
|
||||||
$scope.doRefresh = function() {
|
$scope.doRefresh = function() {
|
||||||
/* events refresh: */
|
/* events refresh: */
|
||||||
//$http.get(urlapi + 'events?page=' + $scope.page)
|
//$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){
|
.then(function(data){
|
||||||
console.log('data success events');
|
console.log('data success events');
|
||||||
console.log(data); // for browser console
|
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.followUser = function(user){
|
||||||
$scope.followingUsers.push(user);
|
$scope.followingUsers.push(user._id);
|
||||||
localStorage.setItem("events_app_followingUsers", JSON.stringify($scope.followingUsers));
|
localStorage.setItem("events_app_followingUsers", JSON.stringify($scope.followingUsers));
|
||||||
};
|
};
|
||||||
$scope.unfollowUser = function(user){
|
$scope.unfollowUser = function(user){
|
||||||
for(var i=0; i<$scope.followingUsers.length; i++) {
|
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);
|
$scope.followingUsers.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ angular.module('app.users', ['pascalprecht.translate'])
|
|||||||
};
|
};
|
||||||
$scope.isUserFollowed = function(user) {
|
$scope.isUserFollowed = function(user) {
|
||||||
for(var i=0; i<$scope.followingUsers.length; i++) {
|
for(var i=0; i<$scope.followingUsers.length; i++) {
|
||||||
if ($scope.followingUsers[i]._id === user._id){
|
if ($scope.followingUsers[i] === user._id){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
<ion-view view-title="Calendar">
|
<ion-view view-title="Calendar">
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
Aquí la idea és un calendari que t'ha enviat el server, on als dies que hi ha coses, apareixen amb colors.
|
||||||
|
I quan cliques a un dia, et porta als events d'aquell dia.
|
||||||
|
<ion-list>
|
||||||
|
<a class="item" ng-href="#/app/byDay/{{day}}" ng-repeat="day in days">
|
||||||
|
{{day | date: 'dd/MMMM'}}
|
||||||
|
</a>
|
||||||
|
</ion-list>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|||||||
5
www/templates/editUser.html
Normal file
5
www/templates/editUser.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ion-view view-title="Edit User">
|
||||||
|
<ion-content>
|
||||||
|
Not yet
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
5
www/templates/newAlert.html
Normal file
5
www/templates/newAlert.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<ion-view view-title="New Alert">
|
||||||
|
<ion-content>
|
||||||
|
Funcionalitat encara no disponible, si hi ha alguna emergència, envia'ns un telegram a @entropiasocial, i crearem l'emergència.
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
7
www/templates/statistics.html
Normal file
7
www/templates/statistics.html
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<ion-view view-title="Statistics">
|
||||||
|
<ion-content>
|
||||||
|
Not yet.
|
||||||
|
Estadístiques de la compta que està loguejada a l'app. Quants events ha publicat, quins dies té més events, etc
|
||||||
|
Quines categories té més events, etc.
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
@@ -2,34 +2,22 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="row o_mainOptionRow">
|
<div class="row o_mainOptionRow">
|
||||||
<a class="col c_pink400" ng-href="#/app/newEvent">
|
<a class="col c_pink400" ng-href="#/app/newEvent">
|
||||||
<i class="icon ion-compose"></i><!--events-->
|
<i class="icon ion-compose"></i><!--new event-->
|
||||||
</a>
|
|
||||||
<a class="col" ng-href="#/app/users">
|
|
||||||
<i class="icon ion-person-stalker"></i>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row o_mainOptionRow">
|
<div class="row o_mainOptionRow">
|
||||||
<a class="col" ng-href="#/app/savedEvents">
|
<a class="col c_indigo400" ng-href="#/app/editUser">
|
||||||
<i class="icon ion-heart"></i>
|
<i class="icon ion-person"></i><!--profile-->
|
||||||
</a>
|
|
||||||
<a class="col" ng-href="#/app/byplace">
|
|
||||||
<i class="icon ion-ios-location"></i><!--by place-->
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row o_mainOptionRow">
|
<div class="row o_mainOptionRow">
|
||||||
<a class="col" ng-href="#/app/search">
|
<a class="col c_orange400" ng-href="#/app/statistics">
|
||||||
<i class="icon ion-search"></i>
|
<i class="icon ion-stats-bars"></i><!--profile-->
|
||||||
</a>
|
|
||||||
<a class="col" ng-href="#/app/byCategories">
|
|
||||||
<i class="icon ion-pound"></i><!--by categories-->
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row o_mainOptionRow">
|
<div class="row o_mainOptionRow">
|
||||||
<a class="col" ng-href="#/app/bydate">
|
<a class="col c_red400" ng-href="#/app/newAlert">
|
||||||
<i class="icon ion-calendar"></i><!--by date-->
|
<i class="icon ion-alert-circled"></i><!--profile-->
|
||||||
</a>
|
|
||||||
<a class="col" ng-href="#/app/settings">
|
|
||||||
<i class="icon ion-ios-gear"></i>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
Reference in New Issue
Block a user