2014-10-26 01:15:43 +02:00
|
|
|
<%
|
|
|
|
var reprValue = function(value) {
|
|
|
|
if (typeof(value) === 'string' || value instanceof String) {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
return JSON.stringify(value);
|
|
|
|
};
|
|
|
|
%>
|
|
|
|
|
2014-09-26 20:41:28 +02:00
|
|
|
<table class="history">
|
|
|
|
<tbody>
|
|
|
|
<% _.each(history, function( historyEntry) { %>
|
|
|
|
<tr>
|
|
|
|
<td class="time">
|
|
|
|
<%= formatRelativeTime(historyEntry.time) %>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td class="user">
|
|
|
|
<% var userName = historyEntry.user && historyEntry.user.name || '' %>
|
|
|
|
|
|
|
|
<% if (userName) { %>
|
|
|
|
<a href="#/user/<%= userName %>">
|
|
|
|
<% } %>
|
|
|
|
|
2014-10-05 11:05:34 +02:00
|
|
|
<img width="20" height="20" class="author-avatar"
|
2014-09-26 20:41:28 +02:00
|
|
|
src="/data/thumbnails/20x20/avatars/<%= userName || '!' %>"
|
|
|
|
alt="<%= userName || 'Anonymous user' %>"/>
|
|
|
|
|
|
|
|
<%= userName || 'Anonymous user' %>
|
|
|
|
|
|
|
|
<% if (userName) { %>
|
|
|
|
</a>
|
|
|
|
<% } %>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td class="subject">
|
2014-11-07 13:52:37 +01:00
|
|
|
<% if (historyEntry.type === 0) { %>
|
2014-09-26 20:41:28 +02:00
|
|
|
<a href="#/post/<%= historyEntry.primaryKey %>">
|
|
|
|
@<%= historyEntry.primaryKey %>
|
|
|
|
</a>
|
2014-11-07 13:52:37 +01:00
|
|
|
<% } else if (historyEntry.type === 1) { %>
|
|
|
|
<a href="#/tag/<%= historyEntry.data.name %>">
|
|
|
|
#<%= historyEntry.data.name %>
|
|
|
|
</a>
|
2014-09-26 20:41:28 +02:00
|
|
|
<% } else { %>
|
|
|
|
?
|
|
|
|
<% } %>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<td class="difference">
|
2014-11-09 17:04:04 +01:00
|
|
|
<% if (historyEntry.operation == 2) { %>
|
2014-09-26 20:41:28 +02:00
|
|
|
deleted
|
|
|
|
<% } else { %>
|
2014-11-09 17:04:04 +01:00
|
|
|
<% if (historyEntry.operation == 0) { %>
|
|
|
|
added
|
|
|
|
<% } else { %>
|
|
|
|
changed
|
|
|
|
<% } %>
|
2014-09-26 20:41:28 +02:00
|
|
|
|
|
|
|
<% if (historyEntry.dataDifference) { %>
|
|
|
|
<ul><!--
|
|
|
|
--><% _.each(historyEntry.dataDifference['+'], function (difference) { %><!--
|
|
|
|
--><li class="addition difference-<%= difference[0] %>"><!--
|
2014-10-26 01:15:43 +02:00
|
|
|
--><%= difference[0] + ':' + reprValue(difference[1]) %><!--
|
2014-09-26 20:41:28 +02:00
|
|
|
--></li><!--
|
|
|
|
--><% }) %><!--
|
|
|
|
|
|
|
|
--><% _.each(historyEntry.dataDifference['-'], function (difference) { %><!--
|
|
|
|
--><li class="removal difference-<%= difference[0] %>"><!--
|
2014-10-26 01:15:43 +02:00
|
|
|
--><%= difference[0] + ':' + reprValue(difference[1]) %><!--
|
2014-09-26 20:41:28 +02:00
|
|
|
--></li><!--
|
|
|
|
--><% }) %><!--
|
|
|
|
--></ul>
|
|
|
|
<% } %>
|
|
|
|
<% } %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% }) %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|