%
moment.lang("en");
var errors = searchResultsCollection.errors;
var results = searchResultsCollection.models;
var query = hashModel.get('notesQuery');
var isConnected = !!currentUserEmail;
var signupIsAllowed = signupIsAllowed || false;
%>
<% if (false === isConnected) { %>
You need to be signed in to annotate documents.
<% if (signupIsAllowed) { %>
Login
or
sign up .
<% } else { %>
Login.
<% } %>
<% } else if (searchResultsCollection.length === 0) { %>
To add a note or a bookmark, select text from your document.
<% } %>
<% if (searchResultsCollection.length > 0) { %>
Print notes
<% qweriLodash.each(searchResultsCollection.models, function(model, index, list) { %>
<%
var modDate = model.get("modificationDate");
var theDate = moment(modDate).format('LL');
var theTime = moment(modDate).format('LT');
var colorAnnotationClass = "";
if (model.get("color")) {
colorAnnotationClass = model.get("color").toLowerCase() + "-annotation"
}
if (currentUserEmail !== model.get("authorEmail")) {
colorAnnotationClass += " external-note";
}
var text = model.get("text");
if (text.length > 180) {
var lastSpace = text.lastIndexOf(" ", 180);
text = text.slice(0, lastSpace) + "...";
}
%>
<% ulToClose = 0 %>
<% qweriLodash.each(model.get("fragmentTitles"), function(title /*, index, list*/) { %>
<% ulToClose++ %>
<%= title %>
<% }); %>
<% for (var i = 0 ; i < ulToClose ; i++) { %>
<% } %>
<% if (model.get("deleted") === true) { %>
[deleted text]
<% } %>
<%= text %>
<% if (model.get("comment").length > 0) { %>
<% } %>
<% if (model.get("publicShared") === true || model.get("groups").length > 0) { %>
Note shared with
<% if (model.get("publicShared") === true) { %>
the public
<% } else { %>
<% if (model.get("groups").length === 1) { %>
the group:
<% } else { %>
the groups:
<% } %>
<%= model.get("groups").join(", ") %>
<% } %>
<% } %>
By <%= model.get("author") %>
on <%= theDate %>
at <%= theTime %>
Edit
Remove
<% }); %>
<% } %>