Sha256: 682c7e19440cc3692ae3fa7b79814f71a12eb421a05328261b911de3938bd77a

Contents?: true

Size: 1.51 KB

Versions: 31

Compression:

Stored size: 1.51 KB

Contents

# Dashboard Event Registrations
class EffectiveEventRegistrationsDatatable < Effective::Datatable
  datatable do
    order :created_at

    col :token, visible: false
    col :created_at, visible: false

    col(:submitted_at, label: 'Registered on') do |er|
      er.submitted_at&.strftime('%F') || 'Incomplete'
    end

    col :event, search: :string do |er|
      link_to(er.event.to_s, effective_events.event_path(er.event))
    end

    col :owner, visible: false, search: :string
    col :status, visible: false
    col :event_registrants, label: 'Registrants', search: :string
    col :event_addons, label: 'Add-ons', search: :string
    col :orders, action: :show, visible: false, search: :string

    actions_col(actions: []) do |er|
      if er.draft?
        dropdown_link_to('Continue', effective_events.event_event_registration_build_path(er.event, er, er.next_step), 'data-turbolinks' => false)
        dropdown_link_to('Delete', effective_events.event_event_registration_path(er.event, er), 'data-confirm': "Really delete #{er}?", 'data-method': :delete)
      else
        dropdown_link_to('Show', effective_events.event_event_registration_path(er.event, er))

        # Register Again
        if er.event.registerable?
          url = er.event.external_registration_url.presence || effective_events.new_event_event_registration_path(er.event)
          dropdown_link_to('Register Again', url)
        end

      end
    end
  end

  collection do
    EffectiveEvents.EventRegistration.deep.where(owner: current_user)
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
effective_events-0.11.3 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.11.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.11.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.11.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.10.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.10.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.10.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.9.3 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.9.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.9.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.9.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.8.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.7.4 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.7.3 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.7.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.7.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.7.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.6.13 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.6.12 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.6.11 app/datatables/effective_event_registrations_datatable.rb