user page and users page added
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 15 KiB |
BIN
app/www/img/avatars/anteater.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
app/www/img/avatars/bat.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/www/img/avatars/beetle.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/www/img/avatars/bulldog.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/butterfly.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/camel.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/www/img/avatars/cat.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/chameleon.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/www/img/avatars/clown-fish.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/www/img/avatars/cobra.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/cow.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/www/img/avatars/crab.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/crocodile.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
app/www/img/avatars/duck.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
app/www/img/avatars/elephant.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/frog.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/www/img/avatars/giraffe.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/hen.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/hippopotamus.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/kangaroo.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/lion.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
app/www/img/avatars/llama.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
app/www/img/avatars/macaw.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/www/img/avatars/monkey.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/www/img/avatars/moose.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/mouse.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/www/img/avatars/octopus.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/www/img/avatars/ostrich.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/owl.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/www/img/avatars/panda.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/pelican.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/penguin.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/www/img/avatars/pig.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/www/img/avatars/rabbit.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/racoon.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/www/img/avatars/ray.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/rhinoceros.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/www/img/avatars/sea-cow.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
app/www/img/avatars/shark.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
app/www/img/avatars/sheep.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
app/www/img/avatars/siberian-husky.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
app/www/img/avatars/sloth.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/www/img/avatars/snake.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/spider.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/www/img/avatars/squirrel.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/www/img/avatars/swan.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
app/www/img/avatars/tiger.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/www/img/avatars/toucan.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/www/img/avatars/turtle.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/www/img/avatars/whale.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
app/www/img/users.png
Normal file
|
After Width: | Height: | Size: 922 B |
@@ -41,14 +41,24 @@ angular.module('starter', ['ionic', 'starter.controllers'])
|
||||
}
|
||||
})
|
||||
|
||||
.state('app.browse', {
|
||||
url: '/browse',
|
||||
.state('app.users', {
|
||||
url: '/users',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/browse.html'
|
||||
templateUrl: 'templates/users.html',
|
||||
controller: 'UsersCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.user', {
|
||||
url: '/users/:username',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/user.html',
|
||||
controller: 'UserCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.travels', {
|
||||
url: '/travels',
|
||||
views: {
|
||||
|
||||
@@ -45,6 +45,7 @@ angular.module('starter.controllers', [])
|
||||
.controller('TravelsCtrl', function($scope, $http, $ionicModal, $timeout) {
|
||||
$scope.travels="";
|
||||
|
||||
$scope.travels=JSON.parse(localStorage.getItem('c_travels'));
|
||||
|
||||
$scope.doRefresh = function() {
|
||||
$http.get('http://localhost:3000/api/travels')
|
||||
@@ -52,6 +53,7 @@ angular.module('starter.controllers', [])
|
||||
console.log('data success');
|
||||
console.log(data); // for browser console
|
||||
$scope.travels = data; // for UI
|
||||
localStorage.setItem('c_travels', JSON.stringify($scope.travels));
|
||||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
||||
})
|
||||
.error(function(data, status, headers,config){
|
||||
@@ -117,6 +119,7 @@ angular.module('starter.controllers', [])
|
||||
console.log(response);
|
||||
$scope.newtravel._id=response.data._id;
|
||||
$scope.travels.push($scope.newtravel);
|
||||
$scope.newtravel={};
|
||||
},
|
||||
function(response) { // optional
|
||||
// failed
|
||||
@@ -176,4 +179,45 @@ angular.module('starter.controllers', [])
|
||||
.then(function(result){
|
||||
travels = result.data;
|
||||
});
|
||||
})
|
||||
|
||||
.controller('UsersCtrl', function($scope, $http, $ionicModal, $timeout) {
|
||||
$scope.users="";
|
||||
|
||||
$scope.users=JSON.parse(localStorage.getItem('c_users'));
|
||||
|
||||
$scope.doRefresh = function() {
|
||||
$http.get('http://localhost:3000/api/users')
|
||||
.success(function(data, status, headers, config){
|
||||
console.log('data success');
|
||||
console.log(data); // for browser console
|
||||
$scope.users = data; // for UI
|
||||
localStorage.setItem('c_users', JSON.stringify($scope.users));
|
||||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
||||
})
|
||||
.error(function(data, status, headers,config){
|
||||
console.log('data error');
|
||||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
||||
})
|
||||
.then(function(result){
|
||||
users = result.data;
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
.controller('UserCtrl', function($scope, $stateParams, $http) {
|
||||
$scope.travel="";
|
||||
console.log($stateParams.username);
|
||||
$http.get('http://localhost:3000/api/users/byusername/'+$stateParams.username)
|
||||
.success(function(data, status, headers,config){
|
||||
console.log('data success');
|
||||
console.log(data); // for browser console
|
||||
$scope.user = data; // for UI
|
||||
})
|
||||
.error(function(data, status, headers,config){
|
||||
console.log('data error');
|
||||
})
|
||||
.then(function(result){
|
||||
travels = result.data;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,18 +29,14 @@
|
||||
<img class='o-imgMenu' src="img/road.png" />
|
||||
Travels
|
||||
</ion-item>
|
||||
<ion-item menu-close href="#/app/browse">
|
||||
<img class='o-imgMenu' src="img/package.png" />
|
||||
Transport material
|
||||
<ion-item menu-close href="#/app/users">
|
||||
<img class='o-imgMenu' src="img/users.png" />
|
||||
Users
|
||||
</ion-item>
|
||||
<ion-item menu-close href="#/app/search">
|
||||
<img class='o-imgMenu' src="img/carimg/station-wagon.png" />
|
||||
Available cars
|
||||
</ion-item>
|
||||
<ion-item menu-close href="#/app/browse">
|
||||
<img class='o-imgMenu' src="img/community.png" />
|
||||
Users
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</ion-content>
|
||||
</ion-side-menu>
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
<ion-content>
|
||||
<div class="item item-avatar">
|
||||
<img ng-src="img/{{travel.modality}}.png" />
|
||||
<span class="badge badge-balanced" ng-show="travel.collectivized">Collectivized</span>
|
||||
<div class="item-note o-text-right">
|
||||
<a class="badge badge-calm" href="#/app/users/{{travel.owner}}">{{travel.owner}}</a>
|
||||
</div>
|
||||
<h2>{{travel.title}}</h2>
|
||||
<p>{{travel.owner}}</p>
|
||||
<div class="">{{travel.date | date:"dd/MM HH:mm a"}}</div>
|
||||
</div>
|
||||
<div class="item item-body">
|
||||
<div class='o-float-right o-text-right'>
|
||||
<div class="">{{travel.date | date:"dd/MM HH:mm a"}}</div>
|
||||
<span class="badge badge-balanced" ng-show="travel.collectivized">Collectivized</span>
|
||||
|
||||
<br>
|
||||
<div class="o-mini-text" ng-show="travel.package">
|
||||
<div ng-show="travel.modality=='offering'">can carry package <img src="img/package.png" class="o-imgMenu" /></div>
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
</p>
|
||||
<p class="" ng-show="travel.modality=='offering'">nºseats: {{travel.seats}}</p>
|
||||
<p class="" ng-show="travel.modality=='asking'">nºpeople: {{travel.seats}}</p>
|
||||
<div class="badge badge-calm item-note">{{travel.owner}}</div>
|
||||
<div class="badge badge-calm item-note">{{travel.date | date:"dd/MM HH:mm a"}}</div>
|
||||
<div class="item-note">
|
||||
<div class="positive">{{travel.date | date:"dd/MM HH:mm a"}}</div>
|
||||
<div class="badge badge-calm">{{travel.owner}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
18
app/www/templates/user.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<ion-view view-title="User">
|
||||
<ion-content>
|
||||
<div class="item item-avatar">
|
||||
<img ng-src="img/avatars/{{user.avatar}}.png" />
|
||||
<div class="item-note o-text-right">
|
||||
<a class="badge badge-calm" href="#/app/users/{{travel.owner}}">{{user.owner}}</a>
|
||||
</div>
|
||||
<h2>{{user.username}}</h2>
|
||||
</div>
|
||||
<div class="item item-body">
|
||||
<p class="o-bold">{{user.description}}</p>
|
||||
<p>{{user.mail}}</p>
|
||||
<p>
|
||||
<img class='o-imgMenu' src="img/telegram.png" /> {{user.telegram}}
|
||||
</p>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
23
app/www/templates/users.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<ion-view view-title="Users">
|
||||
<ion-content>
|
||||
<ion-refresher
|
||||
pulling-text="Pull to refresh..."
|
||||
on-refresh="doRefresh()">
|
||||
</ion-refresher>
|
||||
<div class="list">
|
||||
<div class="o-float-right">
|
||||
<a ng-click="showNewAskingTravel()" class="button icon ion-email"></a>
|
||||
<a ng-click="showNewAskingTravel()" class="button icon ion-help"></a>
|
||||
<a ng-click="showNewOfferingTravel()" class="button icon ion-plus"></a>
|
||||
</div>
|
||||
|
||||
<a ng-repeat="user in users | orderBy: 'date'" class="item item-avatar" href="#/app/users/{{user.username}}">
|
||||
<img ng-src="img/avatars/{{user.avatar}}.png">
|
||||
<h2>{{user.username}}</h2>
|
||||
<p>
|
||||
{{user.description}}
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||