<% var reprValue = function(value) { if (typeof(value) === 'string' || value instanceof String) { return value; } return JSON.stringify(value); }; %>

History

<% _.each(history, function( historyEntry) { %> <% }) %>
<%= formatRelativeTime(historyEntry.time) %> <% var userName = historyEntry.user && historyEntry.user.name || '' %> <% if (userName) { %> <% } %> <%= userName || 'Anonymous user' %> <%= userName || 'Anonymous user' %> <% if (userName) { %> <% } %> <% if (historyEntry.type == 0) { %> @<%= historyEntry.primaryKey %> <% } else { %> ? <% } %> <% if (historyEntry.operation == 1) { %> deleted <% } else { %> changed <% if (historyEntry.dataDifference) { %>
    <% _.each(historyEntry.dataDifference['+'], function (difference) { %>
  • <%= difference[0] + ':' + reprValue(difference[1]) %>
  • <% }) %><% _.each(historyEntry.dataDifference['-'], function (difference) { %>
  • <%= difference[0] + ':' + reprValue(difference[1]) %>
  • <% }) %>
<% } %> <% } %>