View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -7,34 +7,33 @@
{% block content %}
<!-- Toolbar -->
<div class="ng-cloak topbar" ng-class="frame.visible && 'shown'">
<div class="inner" ng-switch="auth.user">
<span class="pull-right" ng-switch-when="undefined">⋯</span>
<div class="dropdown pull-right user-picker">
<span role="button"
class="dropdown-toggle"
data-toggle="dropdown">{% raw %}{{ auth.user|persona }}{% endraw %}<!--
--><span class="provider" ng-show="auth.user">/{% raw %}{{ auth.user|persona:'provider' }}{% endraw %}</span><!--
--><i class="h-icon-arrow-drop-down"></i></span>
<ul class="dropdown-menu pull-right" role="menu">
<li ng-show="auth.user"><a href="" ng-click="accountDialog.visible='true'">Account</a></li>
<li><a href="mailto:support@hypothes.is">Feedback</a></li>
<li><a href="/docs/help" target="_blank">Help</a></li>
<li ng-show="auth.user"><a href="/stream?q=user:{% raw %}{{ auth.user|persona }}{% endraw %}"
target="_blank">My Annotations</a></li>
<li ng-show="auth.user"><a href="" ng-click="logout()">Sign out</a></li>
</ul>
<div class="inner content">
<div class="pull-left">
<button class="btn btn-clean"
ng-click="shareDialog.visible = !shareDialog.visible"
ng-show="showShareButton"
><i href="" title="Share this page" class="h-icon-share btn-icon"></i></button>
</div>
<a class="pull-right" href=""
ng-click="login()"
ng-switch-when="null">Sign in</a>
<!-- Share this page -->
<span class="share-dialog-toggle" ng-show="showShareButton">
<i class="h-icon-share"
title="Share this page"
ng-click="shareDialog.visible = !shareDialog.visible"></i>
</span>
<!-- / Share this page -->
<div class="pull-right" ng-switch="auth.user">
<span ng-switch-when="undefined">⋯</span>
<a href="" ng-click="login()" ng-switch-when="null">Sign in</a>
<div class="dropdown pull-right user-picker">
<span role="button"
class="dropdown-toggle"
data-toggle="dropdown">{% raw %}{{ auth.user|persona }}{% endraw %}<!--
--><span class="provider" ng-show="auth.user">/{% raw %}{{ auth.user|persona:'provider' }}{% endraw %}</span><!--
--><i class="h-icon-arrow-drop-down"></i></span>
<ul class="dropdown-menu pull-right" role="menu">
<li ng-show="auth.user"><a href="" ng-click="accountDialog.visible='true'">Account</a></li>
<li><a href="mailto:support@hypothes.is">Feedback</a></li>
<li><a href="/docs/help" target="_blank">Help</a></li>
<li ng-show="auth.user"><a href="/stream?q=user:{% raw %}{{ auth.user|persona }}{% endraw %}"
target="_blank">My Annotations</a></li>
<li ng-show="auth.user"><a href="" ng-click="logout()">Sign out</a></li>
</ul>
</div>
</div>
<!-- Searchbar -->
<div class="simple-search"
View
@@ -13,7 +13,7 @@ render the feed to Atom XML.
<updated>{{ feed.updated }}</updated>
{% for link in feed.links %}
<link rel="{{ link.rel }}" type="{{ link.type }}" href="{{ link.href }}" />
<link rel="{{ link.rel }}" {% if link.type %}type="{{ link.type }}"{% endif %} type="{{ link.type }}" href="{{ link.href }}" />
{% endfor %}
{% for entry in feed.entries %}
@@ -26,7 +26,7 @@ render the feed to Atom XML.
<name>{{ entry.author.name }}</name>
</author>
{% for link in entry.links %}
<link rel="{{ link.rel }}" type="{{ link.type }}" href="{{ link.href }}" />
<link rel="{{ link.rel }}" {% if link.type %}type="{{ link.type }}"{% endif %} href="{{ link.href }}" />
{% endfor %}
<content type="html">
{# This is already HTML-escaped in Python, so we don't escape it again
View
@@ -35,8 +35,15 @@
<!-- / Editing controls -->
</span>
<span class="annotation-collapsed-replies">
<a class="reply-count small" href=""
ng-click="replyCountClick()"
ng-pluralize count="replyCount"
when="{'0': '', 'one': '1 reply', 'other': '{} replies'}"></a>
</span>
<!-- Timestamp -->
<a class="annotation-timestamp small pull-right"
<a class="annotation-timestamp"
target="_blank"
title="{{vm.annotation.updated | moment:'LLLL'}}"
ng-if="!vm.editing && vm.annotation.updated"
View
@@ -2,16 +2,16 @@
class="threadexp"
title="{{vm.collapsed && 'Expand' || 'Collapse'}}"
ng-click="vm.toggleCollapsed()">
<span ng-class="{'h-icon-expand-more': !!vm.collapsed,
'h-icon-expand-less': !vm.collapsed}"></span>
<span ng-class="{'h-icon-arrow-right': !!vm.collapsed,
'h-icon-arrow-drop-down': !vm.collapsed}"></span>
</a>
<!-- Annotation -->
<div ng-if="vm.container && !vm.container.message" class="thread-deleted">
<p><em>Message not available.</em></p>
</div>
<article class="annotation thread-message"
<article class="annotation thread-message {{vm.collapsed && 'collapsed'}}"
name="annotation"
annotation="vm.container.message"
annotation-embedded="{{isEmbedded}}"
View
@@ -336,3 +336,23 @@ def test_annotation_with_non_unicode_characters():
assert exact_text in entry["content"]
assert entry["title"] == document_title
assert text in entry["content"]
def test_annotation_with_targets():
annotation = factories.Annotation()
annotation2 = factories.Annotation()
target1 = annotation["target"][0]
target2 = annotation2["target"][0]
annotation["target"] = [target1, target2]
feed = atom_feed._feed_from_annotations(
[annotation], atom_url=None,
annotation_url=_mock_annotation_url_function())
assert len(feed["entries"][0]["links"]) == 3
assert feed["entries"][0]["links"][1]["rel"] == "related"
assert feed["entries"][0]["links"][1]["href"] == target1["source"]
assert feed["entries"][0]["links"][2]["rel"] == "related"
assert feed["entries"][0]["links"][2]["href"] == target2["source"]