Browse Source

getEvents by following users, and some pages

master
arnaucode 7 years ago
parent
commit
baa74e1921
14 changed files with 117 additions and 28 deletions
  1. +1
    -1
      bower.json
  2. +6
    -2
      www/index.html
  3. +31
    -1
      www/js/app.js
  4. +12
    -0
      www/js/calendar.js
  5. +8
    -0
      www/js/editUser.js
  6. +8
    -1
      www/js/events.js
  7. +8
    -0
      www/js/newAlert.js
  8. +8
    -0
      www/js/statistics.js
  9. +3
    -3
      www/js/users.js
  10. +7
    -0
      www/templates/calendar.html
  11. +5
    -0
      www/templates/editUser.html
  12. +5
    -0
      www/templates/newAlert.html
  13. +7
    -0
      www/templates/statistics.html
  14. +8
    -20
      www/templates/userZone.html

+ 1
- 1
bower.json

@ -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"
} }
} }

+ 6
- 2
www/index.html

@ -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>

+ 31
- 1
www/js/app.js

@ -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

+ 12
- 0
www/js/calendar.js

@ -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
- 0
www/js/editUser.js

@ -0,0 +1,8 @@
angular.module('app.editUser', ['pascalprecht.translate'])
.controller('EditUserCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
});

+ 8
- 1
www/js/events.js

@ -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
- 0
www/js/newAlert.js

@ -0,0 +1,8 @@
angular.module('app.newAlert', ['pascalprecht.translate'])
.controller('NewAlertCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
});

+ 8
- 0
www/js/statistics.js

@ -0,0 +1,8 @@
angular.module('app.statistics', ['pascalprecht.translate'])
.controller('StatisticsCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
});

+ 3
- 3
www/js/users.js

@ -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;
} }
} }

+ 7
- 0
www/templates/calendar.html

@ -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
- 0
www/templates/editUser.html

@ -0,0 +1,5 @@
<ion-view view-title="Edit User">
<ion-content>
Not yet
</ion-content>
</ion-view>

+ 5
- 0
www/templates/newAlert.html

@ -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
- 0
www/templates/statistics.html

@ -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>

+ 8
- 20
www/templates/userZone.html

@ -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-->
</a>
<a class="col" ng-href="#/app/users">
<i class="icon ion-person-stalker"></i>
<i class="icon ion-compose"></i><!--new event-->
</a> </a>
</div> </div>
<div class="row o_mainOptionRow"> <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> </a>
</div> </div>
<div class="row o_mainOptionRow"> <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>
<div class="row o_mainOptionRow"> <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> </a>
</div> </div>
</ion-content> </ion-content>

Loading…
Cancel
Save