mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-06 19:26:41 +01:00
getEvents by following users, and some pages
This commit is contained in:
@@ -8,6 +8,6 @@
|
||||
"angular-translate": "^2.14.0",
|
||||
"ui-leaflet": "^2.0.0",
|
||||
"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/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
|
||||
<link href="css/ionic.app.css" rel="stylesheet">
|
||||
-->
|
||||
@@ -44,6 +42,9 @@
|
||||
<script src="lib/angular-translate/angular-translate.js"></script>
|
||||
<script src="js/translations.js"></script>
|
||||
|
||||
<!-- momentjs -->
|
||||
<script src="lib/moment/moment.js"></script>
|
||||
|
||||
<!-- your app's js -->
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/menu.js"></script>
|
||||
@@ -64,6 +65,9 @@
|
||||
<script src="js/login.js"></script>
|
||||
<script src="js/userZone.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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<ion-view view-title="Calendar">
|
||||
<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-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>
|
||||
<div class="row o_mainOptionRow">
|
||||
<a class="col c_pink400" ng-href="#/app/newEvent">
|
||||
<i class="icon ion-compose"></i><!--events-->
|
||||
</a>
|
||||
<a class="col" ng-href="#/app/users">
|
||||
<i class="icon ion-person-stalker"></i>
|
||||
<i class="icon ion-compose"></i><!--new event-->
|
||||
</a>
|
||||
</div>
|
||||
<div class="row o_mainOptionRow">
|
||||
<a class="col" ng-href="#/app/savedEvents">
|
||||
<i class="icon ion-heart"></i>
|
||||
</a>
|
||||
<a class="col" ng-href="#/app/byplace">
|
||||
<i class="icon ion-ios-location"></i><!--by place-->
|
||||
<a class="col c_indigo400" ng-href="#/app/editUser">
|
||||
<i class="icon ion-person"></i><!--profile-->
|
||||
</a>
|
||||
</div>
|
||||
<div class="row o_mainOptionRow">
|
||||
<a class="col" ng-href="#/app/search">
|
||||
<i class="icon ion-search"></i>
|
||||
</a>
|
||||
<a class="col" ng-href="#/app/byCategories">
|
||||
<i class="icon ion-pound"></i><!--by categories-->
|
||||
</a>
|
||||
<a class="col c_orange400" ng-href="#/app/statistics">
|
||||
<i class="icon ion-stats-bars"></i><!--profile-->
|
||||
</a>
|
||||
</div>
|
||||
<div class="row o_mainOptionRow">
|
||||
<a class="col" ng-href="#/app/bydate">
|
||||
<i class="icon ion-calendar"></i><!--by date-->
|
||||
</a>
|
||||
<a class="col" ng-href="#/app/settings">
|
||||
<i class="icon ion-ios-gear"></i>
|
||||
<a class="col c_red400" ng-href="#/app/newAlert">
|
||||
<i class="icon ion-alert-circled"></i><!--profile-->
|
||||
</a>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
Reference in New Issue
Block a user