<% 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) { %>
    <% _.each(searchResultsCollection.models, function(model, index, list) { %> <% var modDate = +(model.get("modificationDate")); // Converting string to number 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) + "..."; } %>
  1. <% ulToClose = 0 %> <% _.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) { %>
    <%= model.get("comment") %>
    <% } %>
    <% if (model.get("publicShared") === true || model.get("groups").length > 0) { %> shared 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 %>
  2. <% }); %>
<% } %>