Commit de0d4802 authored by Sheetal Umesh Kumar's avatar Sheetal Umesh Kumar Committed by Robert Knight

Fix broken loggedout CTA.

* Create a loggedout-message directive
* Move related html to separate template

https://trello.com/c/dR3qXaxx/257-add-explanatory-text-below-public-focused-annotation-when-logged-out
parent 9d074792
...@@ -139,6 +139,7 @@ module.exports = angular.module('h', [ ...@@ -139,6 +139,7 @@ module.exports = angular.module('h', [
.directive('formValidate', require('./directive/form-validate')) .directive('formValidate', require('./directive/form-validate'))
.directive('groupList', require('./directive/group-list').directive) .directive('groupList', require('./directive/group-list').directive)
.directive('hAutofocus', require('./directive/h-autofocus')) .directive('hAutofocus', require('./directive/h-autofocus'))
.directive('loggedoutMessage', require('./directive/loggedout-message'))
.directive('loginForm', require('./directive/login-form').directive) .directive('loginForm', require('./directive/login-form').directive)
.directive('markdown', require('./directive/markdown')) .directive('markdown', require('./directive/markdown'))
.directive('simpleSearch', require('./directive/simple-search')) .directive('simpleSearch', require('./directive/simple-search'))
......
'use strict';
module.exports = function () {
return {
bindToController: true,
controllerAs: 'vm',
//@ngInject
controller: function (settings) {
this.serviceUrl = settings.serviceUrl;
},
restrict: 'E',
scope: {
/**
* Called when the user clicks on the "Sign in" text.
*/
onLogin: '&',
},
templateUrl: 'loggedout_message.html',
};
};
<!-- message to display to loggedout users when they visit direct linked annotations -->
<li class="loggedout-message">
<span>
This is a public annotation created with Hypothesis.
<br>
To reply or make your own annotations on this document,
<a class="loggedout-message__link" href="{{vm.serviceUrl}}register" target="_blank">create a free account</a>
or
<a class="loggedout-message__link" href="" ng-click="vm.onLogin()">sign in</a>.
</span>
<span class="loggedout-message-logo">
<a href="https://hypothes.is">
<i class="h-icon-hypothesis-logo loggedout-message-logo__icon"></i>
</a>
</span>
</li>
...@@ -40,20 +40,8 @@ ...@@ -40,20 +40,8 @@
ng-repeat="child in threadRoot.children | orderBy : sort.predicate" ng-repeat="child in threadRoot.children | orderBy : sort.predicate"
ng-show="vm.shouldShow()"> ng-show="vm.shouldShow()">
</li> </li>
<li class="loggedout-message" ng-if="isSidebar && shouldShowLoggedOutMessage()" ng-cloak> <loggedout-message ng-if="isSidebar && shouldShowLoggedOutMessage()"
<span> on-login="login()" ng-cloak>
This is a public annotation created with Hypothesis. </loggedout-message>
<br>
To reply or make your own annotations on this document,
<a class="loggedout-message__link" href="{{ register_url }}" target="_blank">create a free account</a>
or
<a class="loggedout-message__link" href="" ng-click="login()">sign in</a>.
</span>
<span class="loggedout-message-logo">
<a href="https://hypothes.is">
<i class="h-icon-hypothesis-logo loggedout-message-logo__icon"></i>
</a>
</span>
</li>
</ul> </ul>
<!-- / Thread view --> <!-- / Thread view -->
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