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

44 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
th
tbody
- @tickets.each do |ticket|
tr
td = link_to("##{ticket.id}", ticket)
td = link_to_creator(ticket)
td = link_to ticket.title, 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_ticket_path(ticket), class: 'glyphicon glyphicon-pencil'
td = link_to '', ticket, data: {:confirm => 'Are you sure to REMOVE this ticket?'}, :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 '', 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 '', 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_ticket_path, class: 'btn btn-sm btn-default'