Skip to content

Commit

Permalink
Merge branch 'mobile/develop' of bitbucket.org:outset_inc/outset into…
Browse files Browse the repository at this point in the history
… mobile/develop

# By Rykov Serge
# Via Rykov Serge
* 'mobile/develop' of bitbucket.org:outset_inc/outset:
  profile display name changed
  add activity issues done meanjs#345, meanjs#346, meanjs#347, 363
  meanjs#347, added new field distance driven, saving it to props.
  fixed isue when we add custom truck and there is no logo for it, displaying text, if there is a logo - displaying only logo
  • Loading branch information
Patrick Fowler committed Sep 24, 2015
2 parents 0e23610 + d3c8f1f commit fbdbc60
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 19 deletions.
18 changes: 18 additions & 0 deletions mobile/scss/modules/activity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@
border: 0;
color: $content-body-text;
}
div{
white-space: normal;
font-size:16px;
color: $content-body-text;
line-height: 20px;
}
}
.driven{
padding: 5px 16px;
font-size: 14px;
font-weight: bold;
background-color: #E6E6E6;
color: #6D6D6C;

i, span{
display: inline-block;
vertical-align: middle;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
.module('activity')
.controller('ActivityAddCtrl', ActivityAddCtrl);

ActivityAddCtrl.$inject = ['$scope','activityService', '$ionicLoading', '$ionicPlatform'];
ActivityAddCtrl.$inject = ['$scope', 'activityService', '$filter', '$ionicLoading', '$ionicPopup', '$ionicPlatform'];

function ActivityAddCtrl($scope, activityService, $ionicLoading, $ionicPlatform) {
function ActivityAddCtrl($scope, activityService, $filter, $ionicLoading, $ionicPopup, $ionicPlatform) {
angular.element(document).ready(
getCurrentPosition
);
Expand All @@ -21,7 +21,7 @@

vm.activity = {
title : '',
message : '',
notes : 'Enter notes about your drive',
location : {
placeName: '',
placeId: '',
Expand All @@ -37,6 +37,7 @@

vm.saveItemToFeed = saveItemToFeed;
vm.close = close;
vm.addNotes= addNotes;
vm.mapIsVisible = true;

$scope.$watch('vm.where', function() {
Expand Down Expand Up @@ -160,6 +161,7 @@
}

function saveItemToFeed() {
vm.activity.location.created = Date.now();
$ionicLoading.show({
template: 'post feed'
});
Expand All @@ -174,6 +176,41 @@
function close(str) {
vm.closeModal(str);
}

function addNotes () {
var notes = vm.activity.notes;

$scope.data = {};

if(notes !== 'Enter notes about your drive'){
$scope.data.notes = notes;
}

var notesPopup = $ionicPopup.show({
template: '<textarea ng-model="data.notes" style="height: 125px; font-size: 16px; line-height: 18px; color: #9b9b9b;" autofocus></textarea>',
title: 'Enter notes about your drive',
scope: $scope,
buttons: [
{ text: 'Cancel' },
{
text: '<b>Save</b>',
type: 'button-positive',
onTap: function(e) {
if (!$scope.data.notes) {
return 'Enter notes about your drive';
} else {
return $scope.data.notes;
}
}
}
]
});

notesPopup.then(function(res) {
if(res) vm.activity.notes = res;
});

}
}
})();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ion-modal-view class="activity view-section min-size">

<ion-header-bar align-title="center">
<button class="button button-clear" ng-click="vm.close()">Close</button>
<button class="button button-clear" ng-click="vm.close()">Cancel</button>
<h1 class="title">Add Activity</h1>
</ion-header-bar>

Expand All @@ -18,25 +18,27 @@ <h1 class="title">Add Activity</h1>
<span class="input-label">Where:</span>
<ion-google-place placeholder="Enter Name of Stop" ng-model="vm.where" />
</label>
<label class="item item-input">
<span class="input-label">Message:</span>
<input type="text" ng-model="vm.activity.message" placeholder="Enter Activity Message">
</label>
<label class="item item-input">
<span class="input-label">When:</span>
<input type="text" ng-model="vm.activity.location.created" onfocus="this.type='date';this.setAttribute('onfocus','');this.blur();this.focus();" placeholder="Enter When You Stop" >
<label class="item item-input" ng-click="vm.addNotes();">
<span class="input-label">Notes:</span>
<div class="notes-holder" ng-bind="vm.activity.notes"></div>
<!--<input type="text" ng-model="vm.activity.notes" placeholder="Enter notes about your drive">-->
</label>

<div id="map" data-tap-disabled="true" ng-if="!!vm.mapIsVisible"></div>

<label class="item item-input">
<span class="input-label">Distance Since Last Post:</span>
<input type="text" ng-if="!!vm.activity.props.slMiles" value="{{vm.activity.props.slMiles}} miles" readonly>
</label>
<div class="driven" ng-if="!!vm.activity.props.slMiles">
<i class="ico ico-milestraveledsmall"></i>
<span>{{vm.activity.props.slMiles}} miles</span>
</div>

<label class="item item-input">
<span class="input-label">Freight Hauled:</span>
<input type="text" ng-model="vm.activity.props.freight" placeholder="" >
</label>
<label class="item item-input">
<span class="input-label">Distance Driven:</span>
<input type="text" ng-model="vm.activity.props.distance" placeholder="" >
</label>
</div>
<input style="position:absolute; left:9999px" type="submit" />
</form>
Expand All @@ -45,7 +47,7 @@ <h1 class="title">Add Activity</h1>

<ion-footer-bar>
<div class="button-bar action-buttons">
<button class="button primary" ng-disabled="!vm.activity.title" ng-click="vm.saveItemToFeed()">Save</button>
<button class="button primary" ng-disabled="!vm.activity.title" ng-click="vm.saveItemToFeed()">Post Your Drive</button>
</div>
</ion-footer-bar>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
vm.isFriend = vm.profileData.friends.indexOf(vm.user.id) >= 0;
vm.feedMessage = vm.isFriend ? 'No feed items' : 'You have to be friends to see user\'s feed';

if(vm.isFriend){
if(!vm.isFriend){
vm.profileData.displayName = vm.profileData.firstName + ' ' + (vm.profileData.lastName && vm.profileData.lastName[0]);
}else{
$ionicLoading.show({template: 'Loading ' + vm.profileData.firstName + '\'s Feed...'});
activityService
.getFeed().then(function (result) {
Expand Down Expand Up @@ -276,5 +278,13 @@
ico: 'ico-tankhazardousactive'
}
};
vm.trucksMap = {
'Peterbilt': 'ico ico-peterbilt-logo',
'International': 'ico ico-international-logo',
'Freightliner': 'ico ico-freightliner-logo',
'Mack Trucks': 'ico ico-mack-logo',
'Kenworth': 'ico ico-kenworth-logo',
'Volvo': 'ico ico-volvo-logo'
}
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1 class="title">Profile | Edit Truck</h1>
<input type="radio" name="trucks" ng-model="vm.currentTruck" value="{{truck.name}}">
<div class="item-content">
<p>{{ truck.name }}</p>
<div class="logo {{ truck.logoClass }}"></div>
<div ng-if="truck.logoClass" class="logo ico {{ truck.logoClass }}"></div>
</div>
</label>
<label class="item item-radio" ng-click="vm.addTruck()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ <h1 class="title" ng-bind="vm.profileData.displayName">Profile</h1>
<span class="item-label">TRUCK:</span>
<span class="item-note">
<div class="logo">
<div class="ico ico-{{ vm.profileData.props.truck.toLowerCase() }}-logo">{{vm.profileData.props.truck}}</div>
<i ng-if="vm.trucksMap[vm.profileData.props.truck]" class="{{vm.trucksMap[vm.profileData.props.truck]}}"></i>
<div ng-if="!vm.trucksMap[vm.profileData.props.truck]">{{vm.profileData.props.truck}}</div>
</div>
</span>
</div>
Expand Down

0 comments on commit fbdbc60

Please sign in to comment.