Sha256: 64ee57921f45cf7c23bf6fd0468bd35dcb0a61f21df1db911e952cf1947dd631

Contents?: true

Size: 1.84 KB

Versions: 24

Compression:

Stored size: 1.84 KB

Contents

module Admin
  class EffectiveEventsDatatable < Effective::Datatable
    filters do
      scope :all
      scope :registerable
      scope :published
      scope :draft
      scope :upcoming
      scope :past
    end

    datatable do
      col :updated_at, visible: false
      col :created_at, visible: false
      col :id, visible: false

      col :title do |event|
        link_to event.title, effective_events.edit_admin_event_path(event)
      end

      col :slug, visible: false

      col :draft?, as: :boolean, visible: false
      col :published?, as: :boolean
      col :published_start_at, as: "Published start"
      col :published_end_at, as: "Published end"

      col :start_at, label: 'Start', visible: false
      col :end_at, label: 'End', visible: false
      col :excerpt, visible: false

      col :registration_start_at, label: 'Registration opens', visible: false
      col :registration_end_at, label: 'Registration closes', visible: false
      col :early_bird_end_at, label: 'Early bird ends', visible: false

      col :early_bird, visible: false do |event|
        if event.early_bird?
          content_tag(:span, event.early_bird_status, class: 'badge badge-success')
        else
          event.early_bird_status
        end
      end

      # These show too much information to be useful to admins, rely on the edit screen
      # col :event_tickets, search: :string
      # col :event_products, search: :string
      # col :event_registrants, search: :string
      # col :event_addons, search: :string

      col :allow_blank_registrants, visible: false
      col :roles, visible: false
      col :authenticate_user, visible: false

      actions_col do |event|
        dropdown_link_to('View Event', effective_events.event_path(event), target: '_blank')
      end
    end

    collection do
      Effective::Event.deep.all
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
effective_events-2.25.1 app/datatables/admin/effective_events_datatable.rb
effective_events-2.25.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.24.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.23.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.23.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.22.2 app/datatables/admin/effective_events_datatable.rb
effective_events-0.22.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.22.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.21.3 app/datatables/admin/effective_events_datatable.rb
effective_events-0.21.2 app/datatables/admin/effective_events_datatable.rb
effective_events-0.21.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.21.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.6 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.5 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.4 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.3 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.2 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.20.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.19.2 app/datatables/admin/effective_events_datatable.rb