user page and users page added

This commit is contained in:
nau
2016-08-28 11:57:21 +02:00
parent a6950029b0
commit 959c9692d3
62 changed files with 120 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
app/www/img/avatars/bat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
app/www/img/avatars/cat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
app/www/img/avatars/cow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
app/www/img/avatars/hen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
app/www/img/avatars/owl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
app/www/img/avatars/pig.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
app/www/img/avatars/ray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
app/www/img/users.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

View File

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

View File

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

View File

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

View File

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

View File

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

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

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