MorningPeak/app/views/client_tickets/index.html.slim
2015-06-18 02:43:32 +02:00

43 lines
1.6 KiB
Plaintext

h1 Listing tickets
table.table.table-condensed.table-striped
thead
tr
td ID
th Creator
th Title
th Description
th State
th Last update
th Last response
th
th
th
th
tbody
- @tickets.each do |ticket|
tr
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.description
- if ticket.state == Ticket::CLOSE
td.bg-danger = ticket.state
- else
td.bg-success = ticket.state
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 '', ticket, class: 'glyphicon glyphicon-eye-open'
td = link_to '', edit_client_ticket_path(ticket), class: 'glyphicon glyphicon-pencil'
/ td = link_to '', ticket, data: {:confirm => 'Are you sure?'}, :method => :delete, class: 'glyphicon glyphicon-remove-sign'
td = link_to '', ticket_respond_path(ticket), class: 'glyphicon glyphicon-comment' if ticket.open?
- if ticket.open?
td = link_to '', client_ticket_close_path(ticket), data: {:confirm => 'Are you sure to CLOSE this ticket?'}, method: :patch, class: 'glyphicon glyphicon-ok-circle'
- elsif ticket.close?
td = link_to '', client_ticket_open_path(ticket), data: {:confirm => 'Are you sure to REOPEN this ticket?'}, method: :patch, class: 'glyphicon glyphicon-remove-circle'
br
= link_to 'New Ticket', new_client_ticket_path, class: 'btn btn-sm btn-default'