From 2c8ad2834da80f24ecd62a71db8f5257b75f096b Mon Sep 17 00:00:00 2001 From: Taylor Kline Date: Thu, 5 Jan 2017 16:55:47 -0500 Subject: [PATCH 1/3] Expose Facebook id and token on user's profile. --- desktop-app/css/app.css | 7 +++++++ desktop-app/js/tinder-desktop.profile.js | 2 ++ desktop-app/templates/profile.html | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/desktop-app/css/app.css b/desktop-app/css/app.css index db6091d..78a867e 100644 --- a/desktop-app/css/app.css +++ b/desktop-app/css/app.css @@ -250,6 +250,13 @@ html, body, body > div.ng-scope { white-space: pre-wrap; } +.identification { +} + +.userid, .token { + text-align: center; +} + .bio.edit { width: 100%; } diff --git a/desktop-app/js/tinder-desktop.profile.js b/desktop-app/js/tinder-desktop.profile.js index d622725..408ca68 100644 --- a/desktop-app/js/tinder-desktop.profile.js +++ b/desktop-app/js/tinder-desktop.profile.js @@ -9,6 +9,8 @@ $scope.isMe = (localStorage['userId'] === $routeParams.userId); + $scope.token = (localStorage['tinderToken']); + $scope.userid = (localStorage['fbUserId']); $scope.backLink = (localStorage.userId === $routeParams.userId) ? '#/swipe' : '#/messages'; $scope.photoIndex = 0; $scope.swapPhoto = function(index) { diff --git a/desktop-app/templates/profile.html b/desktop-app/templates/profile.html index a714df8..52aa00d 100644 --- a/desktop-app/templates/profile.html +++ b/desktop-app/templates/profile.html @@ -16,6 +16,15 @@

{{user.birth_date | bdayToAge}} 

{{user.distance_mi | distanceToUnits}} {{'PROFILE.AWAY' | translate}}, {{'PROFILE.ACTIVE' | translate}} {{user.ping_time | timeFromNow}}

+

+

Facebook user id: {{ userid }}
+
+ Token: + Show + {{ token }} + Hide +
+

{{school.name}} From 28158d39f589b8a5789ed5c0997219b05bf1bf11 Mon Sep 17 00:00:00 2001 From: Taylor Kline Date: Thu, 12 Jan 2017 21:16:55 -0600 Subject: [PATCH 2/3] Use translatable strings --- desktop-app/templates/profile.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop-app/templates/profile.html b/desktop-app/templates/profile.html index 52aa00d..e534cf1 100644 --- a/desktop-app/templates/profile.html +++ b/desktop-app/templates/profile.html @@ -17,12 +17,12 @@

{{user.distance_mi | distanceToUnits}} {{'PROFILE.AWAY' | translate}}, {{'PROFILE.ACTIVE' | translate}} {{user.ping_time | timeFromNow}}

-

Facebook user id: {{ userid }}
+
{{'PROFILE.FB_USER_ID' | translate}}: {{ userid }}
- Token: - Show + {{'PROFILE.TOKEN' | translate}}: + {{'PROFILE.SHOW' | translate}} {{ token }} - Hide + {{'PROFILE.HIDE' | translate}}

From 08fa36d78ef75e316f0aa14798a67322af84c58c Mon Sep 17 00:00:00 2001 From: Taylor Kline Date: Thu, 12 Jan 2017 22:07:34 -0600 Subject: [PATCH 3/3] Allow toggling of displaying FB token info via settings --- desktop-app/js/tinder-desktop.profile.js | 5 +++-- desktop-app/js/tinder-desktop.settings.js | 3 ++- desktop-app/locales/en.json | 9 ++++++++- desktop-app/templates/profile.html | 4 ++-- desktop-app/templates/settings.html | 15 +++++++++++++++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/desktop-app/js/tinder-desktop.profile.js b/desktop-app/js/tinder-desktop.profile.js index 408ca68..c24e33f 100644 --- a/desktop-app/js/tinder-desktop.profile.js +++ b/desktop-app/js/tinder-desktop.profile.js @@ -1,13 +1,14 @@ (function() { - var module = angular.module('tinder-desktop.profile', ['ngRoute', 'tinder-desktop.api', 'tinder-desktop.common']); + var module = angular.module('tinder-desktop.profile', ['ngRoute', 'tinder-desktop.api', 'tinder-desktop.common', 'tinder-desktop.settings']); - module.controller('ProfileController', function($scope, $route, $routeParams, API) { + module.controller('ProfileController', function($scope, $route, $routeParams, API, Settings) { API.userInfo($routeParams.userId).then(function(user) { $scope.user = user; $scope.bioTextArea = $scope.user.bio; }); + $scope.showFbInfo = Settings.get('show_fb_token') === "yes"; $scope.isMe = (localStorage['userId'] === $routeParams.userId); $scope.token = (localStorage['tinderToken']); $scope.userid = (localStorage['fbUserId']); diff --git a/desktop-app/js/tinder-desktop.settings.js b/desktop-app/js/tinder-desktop.settings.js index 7f2e68d..a8050b6 100644 --- a/desktop-app/js/tinder-desktop.settings.js +++ b/desktop-app/js/tinder-desktop.settings.js @@ -11,7 +11,8 @@ // set defaults here landingPage : '/swipe', messageListExtraInfo : 'yes', - distanceUnits: 'mi' + distanceUnits: 'mi', + show_fb_token: "no" } }; diff --git a/desktop-app/locales/en.json b/desktop-app/locales/en.json index bb5ca46..830b044 100644 --- a/desktop-app/locales/en.json +++ b/desktop-app/locales/en.json @@ -27,7 +27,11 @@ "TITLE": "Profile", "AWAY": "away", "ACTIVE": "active", - "AT": "at" + "AT": "at", + "SHOW": "Show", + "HIDE": "Hide", + "TOKEN": "Token", + "FB_USER_ID": "Facebook user id" }, "SETTINGS": { "TITLE": "Settings", @@ -42,6 +46,9 @@ "DISTANCE_UNITS": "Distance Units", "MILES": "Miles", "KILOMETRES": "Kilometres", + "DISPLAY_FB_TOKEN": "Display Facebook token on my Profile", + "FB_TOKEN_ON": "Display Facebook user ID and token", + "FB_TOKEN_OFF": "Hide Facebook user ID and token", "LOGOUT": "Logout", "CLICK_TO_LOGOUT": "Click to Logout" }, diff --git a/desktop-app/templates/profile.html b/desktop-app/templates/profile.html index e534cf1..ec405bd 100644 --- a/desktop-app/templates/profile.html +++ b/desktop-app/templates/profile.html @@ -16,7 +16,7 @@

{{user.birth_date | bdayToAge}} 

{{user.distance_mi | distanceToUnits}} {{'PROFILE.AWAY' | translate}}, {{'PROFILE.ACTIVE' | translate}} {{user.ping_time | timeFromNow}}

-

+

{{'PROFILE.FB_USER_ID' | translate}}: {{ userid }}
{{'PROFILE.TOKEN' | translate}}: @@ -24,7 +24,7 @@

{{user.distance_mi | distanceToUnits}} {{'PROFILE.AWAY' {{ token }} {{'PROFILE.HIDE' | translate}}

-

+

{{school.name}} diff --git a/desktop-app/templates/settings.html b/desktop-app/templates/settings.html index 254ae0a..8ab26e8 100644 --- a/desktop-app/templates/settings.html +++ b/desktop-app/templates/settings.html @@ -60,6 +60,21 @@
+

+ + +
+ +
+ +
+