h1.page-header = t ".page.title" table.table.table-condensed thead tr th ID th = t ".title" th = t ".description" th = t ".state" th = t ".last_update" th = t ".last_response" th th th tbody - @tickets.each do |ticket| tr class="#{ticket.creator_view_at.nil? ? 'bg-warning' : ''}" td = link_to("##{ticket.id}", client_ticket_path(ticket)) td = link_to ticket.title, client_ticket_path(ticket) td = ticket.short_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.comments.empty? ? "never" : distance_of_time_in_words_to_now(ticket.comments.first.updated_at) td = link_to (t "show"), ticket td = link_to (t "edit"), edit_client_ticket_path(ticket) - if ticket.open? td = link_to (t "close"), client_ticket_close_path(ticket), data: {:confirm => 'Are you sure?'}, :method => :patch - elsif ticket.close? td = link_to (t "reopen"), client_ticket_open_path(ticket), data: {:confirm => 'Are you sure?'}, :method => :patch br = link_to (t "new"), new_client_ticket_path, class: 'btn btn-sm btn-default'