Skip to content

Commit

Permalink
Fix the "create a free account" link on the sidebar CTA
Browse files Browse the repository at this point in the history
  • Loading branch information
nickstenning committed Jul 27, 2016
1 parent 9469c27 commit 19281b7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions h/static/scripts/app-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module.exports = function AppController(
// the stream page or an individual annotation page.
$scope.isSidebar = $window.top !== $window;

$scope.serviceUrl = settings.serviceUrl;

$scope.sortKey = function () {
return annotationUI.getState().sortKey;
};
Expand Down
6 changes: 6 additions & 0 deletions h/static/scripts/test/app-controller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('AppController', function () {

fakeSettings = {
firstRun: false,
serviceUrl: 'http://fake.service.com/',
};

$provide.value('annotationUI', fakeAnnotationUI);
Expand Down Expand Up @@ -185,6 +186,11 @@ describe('AppController', function () {
});
});

it('exposes the serviceUrl on the scope', function () {
createController();
assert.equal($scope.serviceUrl, 'http://fake.service.com/');
});

it('does not show login form for logged in users', function () {
createController();
assert.isFalse($scope.accountDialog.visible);
Expand Down
2 changes: 1 addition & 1 deletion h/templates/client/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="create-account-banner" ng-if="isSidebar && auth.status === 'logged-out'" ng-cloak>
To annotate this document
<a href="{{ register_url }}" target="_blank">
<a href="{{ serviceUrl }}register" target="_blank">
create a free account
</a>
or <a href="" ng-click="login()">log in</a>
Expand Down

0 comments on commit 19281b7

Please sign in to comment.