diff --git a/www/css/intro.css b/www/css/intro.css index 60b694338..b636a38d6 100644 --- a/www/css/intro.css +++ b/www/css/intro.css @@ -31,19 +31,11 @@ padding-left: 8%; font-size: 18px; } -.intro-text-large { - padding-top: 5%; - padding-right: 8%; - padding-left: 8%; - font-size: 18px; - line-height: 1.5; - text-align: left; -} .intro-text { padding-top: 5%; padding-right: 8%; padding-left: 8%; - font-size: 16px; + font-size: 15px; line-height: 1.5; text-align: left; } @@ -64,7 +56,7 @@ padding-top: 5%; padding-right: 8%; padding-left: 8%; - font-size: 16px; + font-size: 15px; line-height: 1.5; text-align: left; } @@ -93,12 +85,3 @@ padding-left: 8%; padding-right: 8%; } -/* rciti start */ -ul { - list-style-type: initial; -} - -ol { - list-style-type: decimal; -} -/* rciti end */ diff --git a/www/css/main.diary.css b/www/css/main.diary.css index abeab2cd4..cc0f33317 100644 --- a/www/css/main.diary.css +++ b/www/css/main.diary.css @@ -140,8 +140,7 @@ a.item-content { line-height: 30px; min-height: 30px; font-size: 0.8em !important; - /* NOTE: Please use ConfirmHelper.inputDetails["key"].width config if you need to resize the button */ - width: 100%; + width: 115px; padding: 0; } .input-confirm-container { diff --git a/www/css/style.css b/www/css/style.css index 27e5bb3ca..33254c355 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -701,14 +701,7 @@ background-image: none !important; } width: 64px; font-size:20px; } -/* rciti start */ -.control-icon-user-profile { - background-color: rgb(201, 217, 236); -} -.control-icon-end-survey { - background-color: #E0A1A1 !important; -} -/* rciti end */ + #switch-user.control-icon-button{ background-color: #E0A1A1 !important; diff --git a/www/i18n/en.json b/www/i18n/en.json index e397b50a1..a1f3dc499 100644 --- a/www/i18n/en.json +++ b/www/i18n/en.json @@ -98,9 +98,9 @@ "consent-found": "Consent found!", "consented-to": "Consented to protocol {{protocol_id}}, {{approval_date}}", "consented-ok": "OK", - "share-message": "Join me in making transportation greener and healthier \nDownload the emTripLog app:", - "share-subject": "UNSW Travel Survey", - "share-url": "https://www.taharashidi.com/travel-survey" + "share-message": "Join me in making transportation greener and healthier \nDownload the emission app:", + "share-subject": "Emission - UC Berkeley Research Project", + "share-url": "https://bic2cal.eecs.berkeley.edu/#download" }, "metrics":{ diff --git a/www/index.html b/www/index.html index 731916c0c..64695133c 100644 --- a/www/index.html +++ b/www/index.html @@ -47,7 +47,7 @@ - + diff --git a/www/js/control/general-settings.js b/www/js/control/general-settings.js index 77bb64d80..3d6578ab1 100644 --- a/www/js/control/general-settings.js +++ b/www/js/control/general-settings.js @@ -13,14 +13,13 @@ angular.module('emission.main.control',['emission.services', 'emission.stats.clientstats', 'emission.plugin.kvstore', 'emission.survey.enketo.demographics', - 'emission.survey.external.launch', 'emission.plugin.logger']) .controller('ControlCtrl', function($scope, $window, $ionicScrollDelegate, $ionicPlatform, $state, $ionicPopup, $ionicActionSheet, $ionicPopover, $ionicModal, $stateParams, - $rootScope, KVStore, SurveyLaunch, ionicDatePicker, + $rootScope, KVStore, ionicDatePicker, StartPrefs, ControlHelper, EmailHelper, UploadHelper, ControlCollectionHelper, ControlSyncHelper, ControlTransitionNotifyHelper, @@ -494,12 +493,6 @@ angular.module('emission.main.control',['emission.services', } }); }; - $scope.launchEndSurvey = function() { - SurveyLaunch.startSurveyPrefilled('https://pe.fourstep.dev/', { - returnURL: 'https://www.taharashidi.com/endsurvey', - }); - $scope.endForceSync(); - }; $scope.userStartStopTracking = function() { if ($scope.settings.collect.trackingOn){ return ControlCollectionHelper.forceTransition('STOP_TRACKING'); diff --git a/www/js/diary/list.js b/www/js/diary/list.js index 349d29c2c..c0f6fc86b 100644 --- a/www/js/diary/list.js +++ b/www/js/diary/list.js @@ -27,11 +27,11 @@ angular.module('emission.main.diary.list',['ui-leaflet', $timeout, ionicDatePicker, leafletData, Timeline, CommonGraph, DiaryHelper, - SurveyOptions, + SurveyOptions, Config, ImperialConfig, PostTripManualMarker, nzTour, KVStore, Logger, UnifiedDataLoader, $ionicPopover, $translate) { console.log("controller DiaryListCtrl called"); const DEFAULT_ITEM_HT = 335; - $scope.surveyOpt = SurveyOptions.ENKETO; + $scope.surveyOpt = SurveyOptions.MULTILABEL; ClientStats.addReading(ClientStats.getStatKeys().LABEL_TAB_SWITCH, {"source": null, "dest": $scope.data? $scope.data.currDay : undefined}); // Add option @@ -161,6 +161,7 @@ angular.module('emission.main.diary.list',['ui-leaflet', ionicDatePicker.openDatePicker($scope.datepickerObject); } + $scope.populateBasicClasses = function(tripgj) { tripgj.display_start_time = DiaryHelper.getLocalTimeString(tripgj.data.properties.start_local_dt); tripgj.display_end_time = DiaryHelper.getLocalTimeString(tripgj.data.properties.end_local_dt); @@ -480,6 +481,7 @@ angular.module('emission.main.diary.list',['ui-leaflet', the code to read the manual inputs is completely different. Instead, let's find the corresponding trip from the label view and copy over the `userInput` (and potentially the `user_input`) values over + */ $scope.$apply(() => { if ($scope.data && $scope.data.currDayTripWrappers) { $scope.data.currDayTripWrappers.forEach(function(tripgj, tripIndex, array) { @@ -493,7 +495,6 @@ angular.module('emission.main.diary.list',['ui-leaflet', console.log("No trips loaded yet, no inputs to copy over"); } }); - */ if($rootScope.barDetail){ readAndUpdateForDay($rootScope.barDetailDate); $rootScope.barDetail = false; diff --git a/www/js/diary/services.js b/www/js/diary/services.js index 4c8910052..8e1d4d217 100644 --- a/www/js/diary/services.js +++ b/www/js/diary/services.js @@ -383,7 +383,7 @@ angular.module('emission.main.diary.services', ['emission.plugin.logger', timeline.data.unifiedConfirmsResults = null; timeline.UPDATE_DONE = "TIMELINE_UPDATE_DONE"; - const surveyOpt = SurveyOptions.ENKETO; + const surveyOpt = SurveyOptions.MULTILABEL; const manualInputFactory = $injector.get(surveyOpt.service); // Internal function, not publicly exposed diff --git a/www/js/intro.js b/www/js/intro.js index 57a330642..28eaec601 100644 --- a/www/js/intro.js +++ b/www/js/intro.js @@ -22,7 +22,7 @@ angular.module('emission.intro', ['emission.splash.startprefs', }); }) -.controller('IntroCtrl', function($scope, $rootScope, $http, $state, $window, +.controller('IntroCtrl', function($scope, $rootScope, $state, $window, $ionicPlatform, $ionicSlideBoxDelegate, $ionicPopup, $ionicHistory, ionicToast, $timeout, CommHelper, StartPrefs, SurveyLaunch, UpdateCheck, i18nUtils) { @@ -105,45 +105,8 @@ angular.module('emission.intro', ['emission.splash.startprefs', }); } - $scope.loginExisting = function() { - $scope.data = {}; - const tokenPopup = $ionicPopup.show({ - template: '', - title: 'Enter the existing token that you have', - scope: $scope, - buttons: [ - { - text: 'OK', - type: 'button-positive', - onTap: function(e) { - if (!$scope.data.existing_token) { - //don't allow the user to close unless he enters a username - - e.preventDefault(); - } else { - return $scope.data.existing_token; - } - } - },{ - text: 'Cancel', - type: 'button-stable', - onTap: function(e) { - return null; - } - } - ] - }); - tokenPopup.then(function(token) { - if (token != null) { - $scope.login(token); - } - }).catch(function(err) { - $scope.alertError(err); - }); - }; - - $scope.login = function(token) { - window.cordova.plugins.BEMJWTAuth.setPromptedAuthToken(token).then(function(userEmail) { + $scope.login = function() { + window.cordova.plugins.BEMJWTAuth.signIn().then(function(userEmail) { // ionicToast.show(message, position, stick, time); // $scope.next(); ionicToast.show(userEmail, 'middle', false, 2500); @@ -151,18 +114,18 @@ angular.module('emission.intro', ['emission.splash.startprefs', $scope.alertError("Invalid login "+userEmail); } else { CommHelper.registerUser(function(successResult) { - ionicToast.show(userEmail, 'middle', false, 2500); - $scope.next(); - // $scope.finish(); + UpdateCheck.getChannel().then(function(retVal) { + CommHelper.updateUser({ + client: retVal + }); + }); + $scope.next(); }, function(errorResult) { - // ionicToast.show(userEmail, 'middle', false, 2500); $scope.alertError('User registration error', errorResult); - // $scope.finish(); }); } }, function(error) { $scope.alertError('Sign in error', error); - // $scope.finish(); }); }; diff --git a/www/js/metrics.js b/www/js/metrics.js index 35233ecd4..19d10f254 100644 --- a/www/js/metrics.js +++ b/www/js/metrics.js @@ -92,13 +92,13 @@ angular.module('emission.main.metrics',['nvd3', /* $scope.onCurrentTrip = function() { - // window.cordova.plugins.BEMDataCollection.getState().then(function(result) { - // Logger.log("Current trip state" + JSON.stringify(result)); - // if(JSON.stringify(result) == "\"STATE_ONGOING_TRIP\""|| - // JSON.stringify(result) == "\"local.state.ongoing_trip\"") { - // $state.go("root.main.current"); - // } - // }); + window.cordova.plugins.BEMDataCollection.getState().then(function(result) { + Logger.log("Current trip state" + JSON.stringify(result)); + if(JSON.stringify(result) == "\"STATE_ONGOING_TRIP\""|| + JSON.stringify(result) == "\"local.state.ongoing_trip\"") { + $state.go("root.main.current"); + } + }); }; */ @@ -112,9 +112,9 @@ angular.module('emission.main.metrics',['nvd3', // If we want to share this function (see the pun?) between the control screen and the dashboard, we need to put it into a service/factory. // But it is not clear to me why it needs to be in the profile screen... var prepopulateMessage = { - message: 'Have fun, support research and get active. Your privacy is protected. \nDownload the emTripLog app:', // not supported on some apps (Facebook, Instagram) - subject: 'Help Sydney become more bikeable and walkable', // fi. for email - url: 'https://www.taharashidi.com/travel-survey' + message: 'Have fun, support research and get active. Your privacy is protected. \nDownload the emission app:', // not supported on some apps (Facebook, Instagram) + subject: 'Help Berkeley become more bikeable and walkable', // fi. for email + url: 'https://bic2cal.eecs.berkeley.edu/#download' } $scope.share = function() { diff --git a/www/js/survey/enketo/service.js b/www/js/survey/enketo/service.js index 450619b6d..186c64ae7 100644 --- a/www/js/survey/enketo/service.js +++ b/www/js/survey/enketo/service.js @@ -104,7 +104,7 @@ angular.module('emission.survey.enketo.service', [ /** * _restoreAnswer restore the most recent answer for the survey * @param {EnketoAnswer[]} answers survey answers - * @returns {Promise} answer string promise + * @returns {string} answer string */ function _restoreAnswer() { if (_state.opts.trip) { diff --git a/www/json/emailConfig.json.sample b/www/json/emailConfig.json.sample index 2a8aadee1..b1e28e63b 100644 --- a/www/json/emailConfig.json.sample +++ b/www/json/emailConfig.json.sample @@ -1,3 +1,3 @@ { - "address": "a.siripanich@unsw.edu.au" + "address": "shankari@eecs.berkeley.edu" } \ No newline at end of file diff --git a/www/json/enketoSurveyConfig.json b/www/json/enketoSurveyConfig.json deleted file mode 100644 index b45e74fef..000000000 --- a/www/json/enketoSurveyConfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "TripConfirmSurvey": { - "formPath": "json/trip-end-survey-multiple-select.json", - "version": 1.2, - "compatibleWith": 1, - "dataKey": "manual/trip_user_input" - }, - "UserProfileSurvey": { - "formPath": "json/user-profile.json", - "version": 1, - "compatibleWith": 1, - "dataKey": "manual/demographic_survey" - } -} diff --git a/www/json/enketoSurveyConfig.json.sample b/www/json/enketoSurveyConfig.json.sample index e67bf707e..b45e74fef 100644 --- a/www/json/enketoSurveyConfig.json.sample +++ b/www/json/enketoSurveyConfig.json.sample @@ -2,11 +2,13 @@ "TripConfirmSurvey": { "formPath": "json/trip-end-survey-multiple-select.json", "version": 1.2, - "compatibleWith": 1 + "compatibleWith": 1, + "dataKey": "manual/trip_user_input" }, "UserProfileSurvey": { "formPath": "json/user-profile.json", "version": 1, - "compatibleWith": 1 + "compatibleWith": 1, + "dataKey": "manual/demographic_survey" } } diff --git a/www/json/trip_confirm_options.json.sample b/www/json/trip_confirm_options.json.sample index 7f1e83d83..5dbdd44d5 100644 --- a/www/json/trip_confirm_options.json.sample +++ b/www/json/trip_confirm_options.json.sample @@ -1,28 +1,28 @@ { "MODE" : [ - {"text":"Vehicle Driver", "value":"driver", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.22031}, - {"text":"Vehicle Passenger","value":"passenger", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.11015}, - {"text":"Walk","value":"walk", "met_equivalent": "WALKING", "co2PerMeter": 0}, - {"text":"Train","value":"train", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.12256}, + {"text":"Walk", "value":"walk", "met_equivalent": "WALKING", "co2PerMeter": 0}, + {"text":"Bike","value":"bike", "met_equivalent": "BICYCLING", "co2PerMeter": 0}, + {"text":"Drove Alone","value":"drove_alone", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.22031}, + {"text":"Shared Ride","value":"shared_ride", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.11015}, + {"text":"Taxi/Uber/Lyft","value":"taxi", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.30741}, {"text":"Bus","value":"bus", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.20727}, - {"text":"Tram","value":"tram", "met_equivalent": "UNKNOWN", "co2PerMeter": 0}, - {"text":"Ferry","value":"ferry", "met_equivalent": "UNKNOWN", "co2PerMeter": 0}, - {"text":"Taxi & Uber","value":"taxi", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.30741}, - {"text":"Bicycle","value":"bike", "met_equivalent": "BICYCLING", "co2PerMeter": 0}, - {"text":"Motorcycle","value":"motorbike", "met_equivalent": "UNKNOWN", "co2PerMeter": 0}, - {"text":"Trip not valid","value":"spurious_trip", "met_equivalent": "UNKNOWN", "co2PerMeter": 0}], + {"text":"Train","value":"train", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.12256}, + {"text":"Free Shuttle","value":"free_shuttle", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.20727}, + {"text":"Air","value":"air", "met_equivalent": "IN_VEHICLE", "co2PerMeter": 0.09975}, + {"text":"Other","value":"other", "met_equivalent": "UNKNOWN", "co2PerMeter": 0}], "PURPOSE" : [ - {"text":"Go Home", "value":"home"}, - {"text":"Work related","value":"work"}, - {"text":"Pick-up/Drop off 🙍‍♂️","value":"pick_drop_person"}, - {"text":"Buy something","value":"buy_something"}, - {"text":"Education","value":"education"}, - {"text":"Social/Dine out","value":"social"}, - {"text":"Recreation/Exercise","value":"exercise"}, - {"text":"Personal/Medical","value":"personal_med"}, - {"text":"Accompany", "value":"accompany_someone"}, - {"text":"Pick-up/Deliver 📦", "value":"pick_drop_thing"}, + {"text":"Home", "value":"home"}, + {"text":"To Work","value":"work"}, + {"text":"At Work","value":"at_work"}, + {"text":"School","value":"school"}, {"text":"Transit transfer", "value":"transit_transfer"}, - {"text":"Other","value":"other"}, - {"text":"Trip not valid","value":"spurious_trip"}] + {"text":"Shopping","value":"shopping"}, + {"text":"Meal","value":"meal"}, + {"text":"Pick-up/Drop off","value":"pick_drop"}, + {"text":"Personal/Medical","value":"personal_med"}, + {"text":"Access Recreation","value":"access_recreation"}, + {"text":"Recreation/Exercise","value":"exercise"}, + {"text":"Entertainment/Social","value":"entertainment"}, + {"text":"Religious", "value":"religious"}, + {"text":"Other","value":"other"}] } diff --git a/www/templates/control/main-control.html b/www/templates/control/main-control.html index bd47809c8..5d840f91c 100644 --- a/www/templates/control/main-control.html +++ b/www/templates/control/main-control.html @@ -5,12 +5,6 @@
-
-
End Survey
-
- -
-
{{'.view-privacy'}}
@@ -28,7 +22,7 @@
{{'.app-status'}}
- - - +
{{'.force-sync'}}
diff --git a/www/templates/intro/consent-text.html b/www/templates/intro/consent-text.html index 023297219..d23736d9a 100644 --- a/www/templates/intro/consent-text.html +++ b/www/templates/intro/consent-text.html @@ -1,94 +1,96 @@ diff --git a/www/templates/intro/intro.html b/www/templates/intro/intro.html index 0204ed0be..aae1b81b9 100644 --- a/www/templates/intro/intro.html +++ b/www/templates/intro/intro.html @@ -1,8 +1,8 @@ - + diff --git a/www/templates/intro/login.html b/www/templates/intro/login.html index f2bd22948..409173bc0 100644 --- a/www/templates/intro/login.html +++ b/www/templates/intro/login.html @@ -1,19 +1,15 @@ -
-

Login via anonymous token 🔑

-

- Use the token given to you in Step 3 of the guided instruction OR via email to login: -

- -
- -
- Should you require any assistance please do not hesitate to contact us: -

-
    -
  • 📧 Email us at a.siripanich@unsw.edu.au
  • -
  • ☎ Call or text 0423-588-117 any day between 09.00-18.00.
  • -
-
- -
\ No newline at end of file +
+

Login via google

+ +
+Currently, we only support logging in via google, since they support techniques +such as two factor authentication for greater security. Participants at UC +Berkeley can choose to login using either their CalNet ID or a personal gmail +account. +
+ +
+ + + diff --git a/www/templates/intro/summary.html b/www/templates/intro/summary.html index fd7070831..2dbd1f0a7 100644 --- a/www/templates/intro/summary.html +++ b/www/templates/intro/summary.html @@ -1,7 +1,7 @@
-

RCITI UNSW

+

E-Mission: Data driven carbon emission reduction

diff --git a/www/templates/main.html b/www/templates/main.html index 287992dcc..f12ca6aed 100644 --- a/www/templates/main.html +++ b/www/templates/main.html @@ -21,19 +21,19 @@ --> - + - - --> + - +