[Tickets] Fix layout on index page

This commit is contained in:
Earlopain 2021-10-30 12:00:38 +02:00
parent 85abba1d00
commit 62d70163ed
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897

View File

@ -1,62 +1,58 @@
<div id="c-tickets">
<div id="a-index">
<%= render partial: 'search' %>
</div>
</div>
<%= render partial: 'search' %>
<h2>Ticket Center</h2>
<table class="valign striped">
<thead>
<tr>
<th style="width:5%">ID</th>
<% if CurrentUser.is_admin? %>
<th style="width:10%">Reporter</th>
<th style="width:10%">Claimed By</th>
<% end %>
<th style="width:15%">Type</th>
<th style="width:25%">Subject</th>
<th style="width:8%">Status</th>
<th style="width:10%">Updated</th>
<th style="width:18%">Created</th>
</tr>
</thead>
<tbody>
<% @tickets.each do |ticket| %>
<tr data-link="<%= ticket_path(ticket) %>">
<td><%= link_to ticket.id, ticket_path(ticket) %></td>
<% if CurrentUser.is_admin? %>
<td>
<%= link_to_user ticket.creator %>
</td>
<td>
<% if ticket.claimant.nil? %>
<span class="redtext">Unclaimed</span>
<% else %>
<%= link_to_user ticket.claimant %>
<h2>Ticket Center</h2>
<table class="valign striped">
<thead>
<tr>
<th style="width:5%">ID</th>
<% if CurrentUser.is_admin? %>
<th style="width:10%">Reporter</th>
<th style="width:10%">Claimed By</th>
<% end %>
</td>
<% end %>
<td><%= link_to ticket.type_title, ticket_path(ticket) %></td>
<th style="width:15%">Type</th>
<th style="width:25%">Subject</th>
<th style="width:8%">Status</th>
<th style="width:10%">Updated</th>
<th style="width:18%">Created</th>
</tr>
</thead>
<% if !ticket.can_see_reason?(CurrentUser.user) %>
<td><span style="cursor:help;" class="redtext" title="Due to privacy concerns, this information is confidential">Confidential</span></td>
<% else %>
<td class="ticket-subject" title="<%= h(truncate(strip_dtext(ticket.reason), length: 200)) %>"><%= link_to h(strip_dtext(truncate(ticket.subject, length: 200))), action: "show", id: ticket.id %></td>
<% end %>
<tbody>
<% @tickets.each do |ticket| %>
<tr data-link="<%= ticket_path(ticket) %>">
<td><%= link_to ticket.id, ticket_path(ticket) %></td>
<% if CurrentUser.is_admin? %>
<td><%= link_to_user ticket.creator %></td>
<td>
<% if ticket.claimant.nil? %>
<span class="redtext">Unclaimed</span>
<% else %>
<%= link_to_user ticket.claimant %>
<% end %>
</td>
<% end %>
<td><%= link_to ticket.type_title, ticket_path(ticket) %></td>
<td class="<%= ticket.status %>-ticket"><%= pretty_ticket_status(ticket) %></td>
<td style="cursor:help;" title="<%= ticket.updated_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(ticket.updated_at) %> ago</td>
<td style="cursor:help;" title="<%= ticket.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(ticket.created_at) %> ago</td>
</tr>
<% end %>
</tbody>
</table>
<% if !ticket.can_see_reason?(CurrentUser.user) %>
<td><span style="cursor:help;" class="redtext" title="Due to privacy concerns, this information is confidential">Confidential</span></td>
<% else %>
<td class="ticket-subject" title="<%= h(truncate(strip_dtext(ticket.reason), length: 200)) %>"><%= link_to h(strip_dtext(truncate(ticket.subject, length: 200))), action: "show", id: ticket.id %></td>
<% end %>
<div id="paginator">
<%= numbered_paginator(@tickets) %>
<td class="<%= ticket.status %>-ticket"><%= pretty_ticket_status(ticket) %></td>
<td style="cursor:help;" title="<%= ticket.updated_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(ticket.updated_at) %> ago</td>
<td style="cursor:help;" title="<%= ticket.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(ticket.created_at) %> ago</td>
</tr>
<% end %>
</tbody>
</table>
<div id="paginator">
<%= numbered_paginator(@tickets) %>
</div>
</div>
</div>
<% render partial: 'secondary_links' %>