]> git.openstreetmap.org Git - rails.git/blob - app/views/user_blocks/_block.html.erb
Truncate long reason texts to not overwhelm the browser window.
[rails.git] / app / views / user_blocks / _block.html.erb
1 <tr>
2   <% c1 = cycle('table0', 'table1') %>
3
4   <% if show_user_name %>
5   <td class="<%= c1 %>"><%= link_to h(block.user.display_name), :controller => 'user', :action => 'view', :display_name => block.user.display_name %></td>
6   <% end %>
7   <% if show_moderator_name %>
8   <td class="<%= c1 %>"><%= link_to h(block.moderator.display_name), :controller => 'user', :action => 'view', :display_name => block.moderator.display_name %></td>
9   <% end %>
10   <td class="<%= c1 %>"><%=h truncate(block.reason) %></td>
11   <td class="<%= c1 %>">
12     <% if block.active? %>
13       <% if block.needs_view? %>
14         <%= t'user_block.partial.until_login' %>
15       <% else %>
16         <%= t('user_block.partial.time_future', :time => distance_of_time_in_words_to_now(block.end_at)) %>
17       <% end %>
18     <% else %>
19       <%= t'user_block.partial.not_active' %>
20     <% end %>
21   </td>
22   <td class="<%= c1 %>">
23     <% if block.revoker_id.nil? %>
24       <%= t('user_block.partial.not_revoked') %>
25     <% else %>
26       <%= link_to h(block.revoker.display_name), :controller => 'user', :action => 'view', :display_name => block.revoker.display_name %>
27     <% end %>
28   </td>
29   <td class="<%= c1 %>"><%= link_to t('user_block.partial.show'), block %></td>
30   <td class="<%= c1 %>"><% if @user and @user.id == block.moderator_id and block.active? %><%= link_to t('user_block.partial.edit'), edit_user_block_path(block) %><% end %></td>
31   <% if show_revoke_link %>
32   <td class="<%= c1 %>"><% if block.active? %><%= link_to t('user_block.partial.revoke'), block, :confirm => t('user_block.partial.confirm'), :action => :revoke %><% end %></td>
33   <% end %>
34 </tr>