Skip to content

Commit

Permalink
add activity issues done meanjs#345, meanjs#346, meanjs#347, 363
Browse files Browse the repository at this point in the history
  • Loading branch information
rykov-md committed Sep 24, 2015
1 parent 8ab4467 commit 6dfa4ce
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 16 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,21 +18,19 @@ <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="" >
Expand All @@ -49,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

0 comments on commit 6dfa4ce

Please sign in to comment.