Sha256: 64aa069223767b0d8db871d39a2ac1d2f26fe8c2d04fc637fb5ce03838979781

Contents?: true

Size: 1.81 KB

Versions: 14

Compression:

Stored size: 1.81 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? || er.submitted?
        dropdown_link_to('Continue', effective_events.event_event_registration_build_path(er.event, er, er.next_step), 'data-turbolinks' => false)
      elsif er.completed?
        if EffectiveResources.authorized?(self, :update_blank_registrants, er)
          dropdown_link_to('Continue', effective_events.event_event_registration_path(er.event, er))
        else
          dropdown_link_to('Show', effective_events.event_event_registration_path(er.event, er))
        end

        # 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

      if EffectiveResources.authorized?(self, :destroy, er)
        dropdown_link_to('Delete', effective_events.event_event_registration_path(er.event, er), 'data-confirm': "Really delete #{er}?", 'data-method': :delete)
      end

    end
  end

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

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
effective_events-0.19.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.19.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.19.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.18.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.18.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.18.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.17.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.16.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.15.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.15.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.14.2 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.14.1 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.14.0 app/datatables/effective_event_registrations_datatable.rb
effective_events-0.13.1 app/datatables/effective_event_registrations_datatable.rb