MorningPeak/app/views/client_tickets/index.html.slim
2015-07-16 22:16:34 +02:00

43 lines
1.6 KiB
Plaintext

h1.page-header = t ".page.title"
table.table.table-condensed
thead
tr
td ID
th = t ".creator"
th = t ".title"
th = t ".description"
th = t ".state"
th = t ".last_update"
th = t ".last_response"
th
th
th
th
tbody
- @tickets.each do |ticket|
tr class="#{ticket.head_creator_view_at.nil? ? 'bg-warning' : ''}"
td = link_to("##{ticket.id}", client_ticket_path(ticket))
td = link_to_creator(ticket)
td = link_to ticket.title, client_ticket_path(ticket)
td = ticket.tickets.empty? ? ticket.description : ticket.tickets.first.description
- if ticket.state == Ticket::CLOSE
td.bg-danger = t ".states.close"
- else
td.bg-success = t ".states.open"
td = ticket.updated_at.to_s(:long)
td = ticket.last_response ? distance_of_time_in_words_to_now(ticket.last_response.updated_at) : "never"
td = link_to (t ".buttons.show"), ticket
td = link_to (t ".buttons.edit"), edit_client_ticket_path(ticket)
/ td = link_to 'Destroy', ticket, data: {:confirm => 'Are you sure?'}, :method => :delete
td = link_to (t ".buttons.respond"), client_ticket_respond_path(ticket) if ticket.open?
- if ticket.open?
td = link_to (t ".buttons.close"), client_ticket_close_path(ticket), data: {:confirm => 'Are you sure?'}, :method => :patch
- elsif ticket.close?
td = link_to (t ".buttons.reopen"), client_ticket_open_path(ticket), data: {:confirm => 'Are you sure?'}, :method => :patch
br
= link_to (t ".buttons.new"), new_client_ticket_path, class: 'btn btn-sm btn-default'