Commit 19281b73 authored by Nick Stenning's avatar Nick Stenning

Fix the "create a free account" link on the sidebar CTA

parent 9469c27a
...@@ -52,6 +52,8 @@ module.exports = function AppController( ...@@ -52,6 +52,8 @@ module.exports = function AppController(
// the stream page or an individual annotation page. // the stream page or an individual annotation page.
$scope.isSidebar = $window.top !== $window; $scope.isSidebar = $window.top !== $window;
$scope.serviceUrl = settings.serviceUrl;
$scope.sortKey = function () { $scope.sortKey = function () {
return annotationUI.getState().sortKey; return annotationUI.getState().sortKey;
}; };
......
...@@ -95,6 +95,7 @@ describe('AppController', function () { ...@@ -95,6 +95,7 @@ describe('AppController', function () {
fakeSettings = { fakeSettings = {
firstRun: false, firstRun: false,
serviceUrl: 'http://fake.service.com/',
}; };
$provide.value('annotationUI', fakeAnnotationUI); $provide.value('annotationUI', fakeAnnotationUI);
...@@ -185,6 +186,11 @@ describe('AppController', function () { ...@@ -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 () { it('does not show login form for logged in users', function () {
createController(); createController();
assert.isFalse($scope.accountDialog.visible); assert.isFalse($scope.accountDialog.visible);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="create-account-banner" ng-if="isSidebar && auth.status === 'logged-out'" ng-cloak> <div class="create-account-banner" ng-if="isSidebar && auth.status === 'logged-out'" ng-cloak>
To annotate this document To annotate this document
<a href="{{ register_url }}" target="_blank"> <a href="{{ serviceUrl }}register" target="_blank">
create a free account create a free account
</a> </a>
or <a href="" ng-click="login()">log in</a> or <a href="" ng-click="login()">log in</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment