app/views/event_tickets/index.html.slim

Summary

Maintainability
Test Coverage
= render 'events/header'
.row
  .span12
    = link_to t('buttons.event_ticket.new'), new_event_ticket_path, :class => "btn btn-info pull-right"
    .tickets-list
      table.table.table-striped
        thead
          tr
            td width='140px'  = t('activerecord.attributes.event_ticket.name')
            td width='140px'  = t('activerecord.attributes.event_ticket.price')
            td width='200px'  = t('activerecord.attributes.event_ticket.require_invoice')
            td = t('activerecord.attributes.event_ticket.description')
            td = t('activerecord.attributes.event_ticket.status')
            td width='140px'   
        tbody
          - @tickets.each do |ticket|
            tr
              td = ticket.name
              td = ticket.price
              td = t('simple_form.options.event_ticket.require_invoice')[ticket.require_invoice?]
              td = ticket.description
              td = t('activerecord.attributes.event_ticket.state_machines.' + ticket.status )
              td.table-operate
                - if ticket.can_reopen?
                  = link_to t('views.tickets.open'), open_event_ticket_path(ticket.event, ticket), method: 'POST', data: { confirm: t('confirmation.tickets.open') }
                - elsif ticket.can_close?
                  = link_to t('views.tickets.close'), close_event_ticket_path(ticket.event, ticket), method: 'POST', data: { confirm: t('confirmation.tickets.close') }
                = link_to t('views.edit'), edit_event_ticket_path(ticket.event, ticket)
                = link_to t('views.destroy'), event_ticket_path(ticket.event, ticket), method: :delete, data: { confirm: t('confirmation.destroy') }
    - if @event.tickets_quantity
      .muted = "总票数:#{@event.tickets_quantity}"