szurubooru/public_html/templates/history.tpl

64 lines
1.6 KiB
Smarty
Raw Normal View History

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">
<% if (historyEntry.type == 0) { %>
<a href="#/post/<%= historyEntry.primaryKey %>">
@<%= historyEntry.primaryKey %>
</a>
<% } else { %>
?
<% } %>
</td>
<td class="difference">
<% if (historyEntry.operation == 1) { %>
deleted
<% } else { %>
changed
<% if (historyEntry.dataDifference) { %>
<ul><!--
--><% _.each(historyEntry.dataDifference['+'], function (difference) { %><!--
--><li class="addition difference-<%= difference[0] %>"><!--
--><%= difference[0] + ':' + difference[1] %><!--
--></li><!--
--><% }) %><!--
--><% _.each(historyEntry.dataDifference['-'], function (difference) { %><!--
--><li class="removal difference-<%= difference[0] %>"><!--
--><%= difference[0] + ':' + difference[1] %><!--
--></li><!--
--><% }) %><!--
--></ul>
<% } %>
<% } %>
</td>
</tr>
<% }) %>
</tbody>
</table>