Sha256: 07ff1fc6d53fed3a5b1db4508cadf540bdba1d2c45b2b3e8128fb4e87887c175

Contents?: true

Size: 1.66 KB

Versions: 7

Compression:

Stored size: 1.66 KB

Contents

module Admin
  class EffectiveEventsDatatable < Effective::Datatable
    filters do
      scope :all
      scope :registerable
      scope :published
      scope :unpublished
      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
      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

      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

7 entries across 7 versions & 1 rubygems

Version Path
effective_events-0.15.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.15.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.14.2 app/datatables/admin/effective_events_datatable.rb
effective_events-0.14.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.14.0 app/datatables/admin/effective_events_datatable.rb
effective_events-0.13.1 app/datatables/admin/effective_events_datatable.rb
effective_events-0.13.0 app/datatables/admin/effective_events_datatable.rb