Skip to content

Commit

Permalink
Merge pull request #630 from atton16/rciti1
Browse files Browse the repository at this point in the history
Rciti1
  • Loading branch information
shankari authored Mar 13, 2020
2 parents 2ddfbb7 + 3c064f2 commit 5f1965c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions www/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,10 @@ background-image: none !important; }
.control-icon-user-profile {
background-color: rgb(201, 217, 236);
}
.control-icon-end-survey {
/* background-color: rgb(169, 226, 186); */
background-color: #E0A1A1 !important;
}


#switch-user.control-icon-button{
Expand Down
10 changes: 10 additions & 0 deletions www/js/control/general-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ angular.module('emission.main.control',['emission.services',
$ionicPlatform,
$state, $ionicPopup, $ionicActionSheet, $ionicPopover,
$rootScope, KVStore, ionicDatePicker,
$cordovaInAppBrowser,
StartPrefs, ControlHelper, EmailHelper,
ControlCollectionHelper, ControlSyncHelper,
ControlTransitionNotifyHelper,
Expand Down Expand Up @@ -415,6 +416,15 @@ angular.module('emission.main.control',['emission.services',
EnketoSurveyLaunch.launch($scope, 'UserProfile');
};

$scope.launchEndSurvey = function() {
CommHelper.getUser().then(function(profile) {
const uuid = profile && profile.user_id && profile.user_id['$uuid'] ? profile.user_id['$uuid'] : 'undefined';
const fieldPath = '/aDHunALXzzHXAUMrvkvRT9/_user_id';
const returnURL = 'https://reward.amarin.dev';
$cordovaInAppBrowser.open(`https://ee.kobotoolbox.org/single/::T9bEosso?d[${fieldPath}]=${uuid}&returnURL=${returnURL}`, '_blank');
});
}

$scope.userStartStopTracking = function() {
if ($scope.settings.collect.trackingOn){
return ControlCollectionHelper.forceTransition('STOP_TRACKING');
Expand Down
18 changes: 12 additions & 6 deletions www/templates/control/main-control.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
<ion-view view-title="{{'control.profile' | translate}}" ng-class="ion-view-background" translate-namespace="control">
<ion-content>
<div class="control-list-item">
<div class="control-list-text">{{settings.auth.email}}</div>
<div ng-click="returnToIntro()" id ="switch-user" class="control-icon-button"><i class="icon ion-log-out"></i></div>
<div class="control-list-text">Logged in as: {{settings.auth.email}}</div>
<!-- <div ng-click="returnToIntro()" id ="switch-user" class="control-icon-button"><i class="icon ion-log-out"></i></div> -->
</div>
<div class="control-list-item">
<div class="control-list-text">My Profile</div>
<div class="control-list-text">Edit User Profile</div>
<div ng-click="editUserProfile()" class="control-icon-button control-icon-user-profile">
<i class="ion-person"></i>
</div>
</div>
<div class="control-list-item">
<div class="control-list-text">End Survey</div>
<div ng-click="launchEndSurvey()" class="control-icon-button control-icon-end-survey">
<i class="ion-document-text"></i>
</div>
</div>
<!-- <div class="control-list-item">
<div class="control-list-text" translate>{{'.tracking'}}</div>
<label ng-click="userStartStopTracking()" class="toggle control-list-toggle toggle-color">
<input type="checkbox" ng-checked="settings.collect.trackingOn">
<div class="track">
<div class="handle"></div>
</div>
</label>
</div>
<div class="control-list-item">
</div> -->
<!-- <div class="control-list-item">
<div class="control-list-text" translate>{{'.medium-accuracy'}}</div>
<label ng-click="toggleLowAccuracy()" class="toggle control-list-toggle toggle-color">
<input type="checkbox" ng-checked="getLowAccuracy()">
<div class="track">
<div class="handle"></div>
</div>
</label>
</div>
</div> -->
<!-- <div class="control-list-item">
<div class="control-list-text" translate>{{'.dark-theme'}}</div>
<label ng-click="toggleDarkTheme()" class="toggle control-list-toggle toggle-color">
Expand Down

0 comments on commit 5f1965c

Please sign in to comment.