journalduhacker/app/views/moderations/index.html.erb
2017-05-17 10:56:24 +02:00

68 lines
2.2 KiB
Plaintext

<div class="box wide">
<div class="legend">
<%= t('.moderationlogtitle') %>
</div>
<table class="data" width="100%" cellspacing=0>
<tr>
<th style="min-width: 150px;"><%= t('.datecolumn') %></th>
<th><%= t('.moderatorcolumn') %></th>
<th><%= t('.reasoncolumn') %></th>
</tr>
<% bit = 0 %>
<% @moderations.each do |mod| %>
<tr class="row<%= bit %> nobottom">
<td><%= mod.created_at.strftime("%Y-%m-%d %H:%M %z") %></td>
<td><% if mod.moderator %>
<a href="/messages?to=<%= mod.moderator.try(:username) %>"><%=
mod.moderator.try(:username) %></a>
<% elsif mod.is_from_suggestions? %>
<em>(<%= t('.users') %>)</em>
<% end %></td>
<td><% if mod.story %>
<a href="<%= mod.story.comments_path %>"><%= t('.storyline') %>: <%= mod.story.title
%></a>
<% elsif mod.comment %>
<a href="<%= mod.comment.url %>"><%= t('.commentline') %>
<%= mod.comment.user.username %>
<%= t('.commenton') %>
<%= mod.comment.story.title %></a>
<% elsif mod.user_id %>
<% if mod.user %>
<a href="/u/<%= mod.user.username %>"><%= t('.user') %>
<%= mod.user.username %></a>
<% else %>
<%= t('.user') %> <%= mod.user_id %> (<%= t('.deleted') %>)
<% end %>
<% end %></td>
</tr>
<tr class="row<%= bit %> <%= mod.reason.present?? "nobottom" : "" %>">
<td colspan=2></td>
<td><%= t('.actionline') %>: <em><%= mod.action %></em></td>
</tr>
<% if mod.reason.present? %>
<tr class="row<%= bit %>">
<td colspan=2></td>
<td><%= t('.reasonline') %>: <em><%= mod.reason %></em></td>
</tr>
<% end %>
<% bit = (bit == 1 ? 0 : 1) %>
<% end %>
</table>
</div>
<div class="morelink">
<% if @page > 1 %>
<a href="/moderations/page/<%= @page - 1 %>">&lt;&lt; <%= t('.page') %>
<%= @page - 1 %></a>
<% end %>
<% if @pages > 1 && @page < @pages %>
<% if @page > 1 %>
|
<% end %>
<a href="/moderations/page/<%= @page + 1 %>"><%= t('.page') %> <%= @page + 1
%> &gt;&gt;</a>
<% end %>
</div>