From 15f318ccc2b455856273d6ff33a1b0f42adc23ac Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 11 Nov 2014 19:11:04 -0700 Subject: [PATCH] feat(sharing): screw it, social links + img + text aint working, just redirect to homepage + show member modal --- public/js/static.js | 15 +++++++ public/manifest.json | 2 + views/shared/header/avatar.jade | 2 +- views/static/front.jade | 78 +++++++++++++++++---------------- 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/public/js/static.js b/public/js/static.js index 66e2b8ee72..860dbf5587 100644 --- a/public/js/static.js +++ b/public/js/static.js @@ -6,6 +6,21 @@ window.habitrpgStatic = angular.module('habitrpgStatic', ['notificationServices' .constant("STORAGE_SETTINGS_ID", 'habit-mobile-settings') .constant("MOBILE_APP", false) +.controller("RootCtrl", ['$scope', '$location', '$modal', '$http', function($scope, $location, $modal, $http){ + // must be #?memberId=xx, see https://github.com/angular/angular.js/issues/7239 + var memberId = $location.search()['memberId']; + if (memberId) { + $http.get('/api/v2/members/'+memberId).success(function(data, status, headers, config){ + $scope.profile = data; + $scope.Content = window.habitrpgShared.content; + $modal.open({ + templateUrl: 'modals/member.html', + scope: $scope + }); + }) + } + }]) + .controller("PlansCtrl", ['$rootScope', function($rootScope) { $rootScope.clickContact = function(){ diff --git a/public/manifest.json b/public/manifest.json index aaa890463c..b2a06332a8 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -99,6 +99,8 @@ "bower_components/bootstrap/dist/css/bootstrap.css", "bower_components/css-social-buttons/css/zocial.css", "bower_components/jquery-colorbox/example1/colorbox.css", + "app.css", + "bower_components/habitrpg-shared/dist/habitrpg-shared.css", "static.css" ] } diff --git a/views/shared/header/avatar.jade b/views/shared/header/avatar.jade index 3c03ac1131..41d70ba1ea 100644 --- a/views/shared/header/avatar.jade +++ b/views/shared/header/avatar.jade @@ -7,7 +7,7 @@ mixin avatar(opts) .character-sprites - .addthis_native_toolbox(ng-if='profile._id==user._id', data-url="#{env.BASE_URL}/export/avatar-{{profile._id}}.png", data-title="Check out my HabitRPG progress!") + .addthis_native_toolbox(ng-if='profile._id==user._id', data-url="#{env.BASE_URL}/static/front/#?memberId={{profile._id}}", data-title="Check out my HabitRPG progress!") // Mount Body if !opts.minimal diff --git a/views/static/front.jade b/views/static/front.jade index 2e03b1fef6..9927ef3551 100644 --- a/views/static/front.jade +++ b/views/static/front.jade @@ -8,41 +8,45 @@ block title title=env.t('titleFront') block content - .marketing - //we need to use something that's not jumbotron for this, but still keep it centered - //could someone write something else to make it pretty? - img(src='/bower_components/habitrpg-shared/img/logo/habitrpg_pixel.png', alt='HabitRPG logo') - //this image needs to be replaced by something more enticing, that shows off the features of hRPG - //while acting similarly to a logo - h1#tagline=env.t('tagline') - p.lead - button.btn.btn-primary.btn-lg#frontpage-play-button(ng-click='playButtonClick()')=env.t('playButton') - hr - img(src='/marketing/devices.png') - //we'd want the tagline centered, for sure, and a bit more pop, but without using jumbotron - //it could also be part of the image, as long as the alt text included it - //in fact, I think I really want it on the image, rather than as text, but language issues - br - p.lead=env.t('landingp1') - h2=env.t('landingp2header') - //images in these parts could be useful, too - //if there's a language workaround, image headers? people like pictures! - p.lead - =env.t('landingp2') - |  - h2=env.t('landingp3header') - //I'm not sold on "Consquences as the title here. Anyone got a better idea? - p.lead - =env.t('landingp3') - |  - h2=env.t('landingp4header') - p.lead=env.t('landingp4') - //- TODO - h2=env.t('landingend') + div(ng-controller='RootCtrl') + include ../shared/header/avatar + include ../shared/modals/members + + .marketing + //we need to use something that's not jumbotron for this, but still keep it centered + //could someone write something else to make it pretty? + img(src='/bower_components/habitrpg-shared/img/logo/habitrpg_pixel.png', alt='HabitRPG logo') + //this image needs to be replaced by something more enticing, that shows off the features of hRPG + //while acting similarly to a logo + h1#tagline=env.t('tagline') p.lead - =env.t('landingend2') - a(href="FEATURESPAGEHERE")=env.t('landingfeatureslink') - =env.t('landingend3') - a(href="ENTERPRISEPAGEHERE")=env.t('landingadminlink') - |  - =env.t('landingend4') + button.btn.btn-primary.btn-lg#frontpage-play-button(ng-click='playButtonClick()')=env.t('playButton') + hr + img(src='/marketing/devices.png') + //we'd want the tagline centered, for sure, and a bit more pop, but without using jumbotron + //it could also be part of the image, as long as the alt text included it + //in fact, I think I really want it on the image, rather than as text, but language issues + br + p.lead=env.t('landingp1') + h2=env.t('landingp2header') + //images in these parts could be useful, too + //if there's a language workaround, image headers? people like pictures! + p.lead + =env.t('landingp2') + |  + h2=env.t('landingp3header') + //I'm not sold on "Consquences as the title here. Anyone got a better idea? + p.lead + =env.t('landingp3') + |  + h2=env.t('landingp4header') + p.lead=env.t('landingp4') + //- TODO + h2=env.t('landingend') + p.lead + =env.t('landingend2') + a(href="FEATURESPAGEHERE")=env.t('landingfeatureslink') + =env.t('landingend3') + a(href="ENTERPRISEPAGEHERE")=env.t('landingadminlink') + |  + =env.t('landingend4')