tickets/app/views/admin/tickets_manage/_ticket.html.erb

45 lines
1.6 KiB
Plaintext

<% return if ticket_counter >= 5 %>
<% case ticket.status
when "open"
badge_class = "t-status-open"
when "closed"
badge_class = "t-status-close"
when "commenced"
badge_class = "t-status-processing"
end
%>
<div class="ticket ticket-item" id="ticket_<%= ticket.id.to_s %>" data-id="<%= ticket.id.to_s %>">
#<%= ticket.uid %> -
<a class="ticket-link" href="<%= admin_tickets_manage_path(ticket.id) %>">
<span class="ticket-title"><%= ticket.subject %></span>
</a>
<% if !ticket.registered_site.nil? %>
<a class="ticket-site-link" href="http://<%= ticket.registered_site.site_domain %>" target="_blank">
<i class="fa fa-external-link"></i>
<%= ticket.registered_site.title %>
</a>
<% else %>
<span class="ticket-site-dead"><i class="fa fa-chain-broken"></i> Site deleted</span>
<% end %>
<span class="ticket-date"><abbr title="<%= ticket.created_at.strftime("%Y/%m/%d %H:%M:%S") %>"><i class="fa fa-calendar" aria-hidden="true"><%= ticket.created_at.strftime("%Y/%m/%d %H:%M:%S") %></i></abbr></span>
<div class="ticket-label pull-right">
<% if ticket.is_urgent? %>
<span class="label label-danger">
<i class="fa fa-fire"></i>
Urgent
</span>
<% end %>
<span class="label <%= badge_class %>">
<i class="fa fa-eye"></i>
<%= ticket.status.capitalize %>
</span>
<% if !ticket.taken_by.nil? %>
<span class="ticket-author label label-primary">
<i class="icon-user"></i>
<% user = User.find(ticket.taken_by) rescue nil %>
<%= !user.nil? ? user.name : "User Deleted" %>
</span>
<% end %>
</div>
</div>