client_management/app/views/client_managements/_site_ticket.html.erb

33 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2017-03-07 09:37:28 +00:00
<% case site_ticket.status
when "open"
badge_class = "tk-open"
when "closed"
badge_class = "tk-close"
when "commenced"
badge_class = "tk-processing"
end
%>
<li class="item-ticket">
<span class="subject-ticket"><a href="/cpanel/ticket/<%= site_ticket.id %>"><%= site_ticket.subject %></a></span>
<div class="info-ticket">
<span class="type-ticket"><i class="fa fa-file" aria-hidden="true"></i>Type : <%= site_ticket.category.title %></span>
<span class="time-ticket"><i class="fa fa-clock-o" aria-hidden="true"></i>Time : <%= site_ticket.created_at.strftime("%d %B %y %H:%M") %></span>
<span class="number-ticket"><i class="fa fa-tags" aria-hidden="true"></i>Number : <%= site_ticket.uid %></span>
</div>
<span class="status-ticket <%= badge_class %>"><%= site_ticket.status.capitalize %></span>
<% if site_ticket.status != "commenced" %>
<span class="action-ticket">
<% case site_ticket.status %>
<% when "open" %>
<a href="/cpanel/ticket/<%= site_ticket.id.to_s %>/close" class="btn btn-warning ticket-action-btn">Close</a>
<% if !site_ticket.reopened? %>
<a href="/cpanel/ticket/<%= site_ticket.id.to_s %>/delete" class="btn btn-danger ticket-action-btn">Delete</a>
<% end %>
<% when "closed" %>
<% if site_ticket.can_be_reopened? %>
<a href="/cpanel/ticket/<%= site_ticket.id.to_s %>/reopen" class="btn btn-info">Reopen</a>
<% end %>
<% end %>
</span>
<% end %>
</li>