Sha256: c6a7d6eb2e866112c3a5d64bad8f5ab16bfdcaf15939a3bb8a77f5f6bfc71664

Contents?: true

Size: 1.93 KB

Versions: 8

Compression:

Stored size: 1.93 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

      col :delayed_payment, visible: false
      col :delayed_payment_date, visible: false

      # 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

8 entries across 8 versions & 1 rubygems

Version Path
effective_events-2.29.1 app/datatables/admin/effective_events_datatable.rb
effective_events-2.29.0 app/datatables/admin/effective_events_datatable.rb
effective_events-2.28.3 app/datatables/admin/effective_events_datatable.rb
effective_events-2.28.2 app/datatables/admin/effective_events_datatable.rb
effective_events-2.28.1 app/datatables/admin/effective_events_datatable.rb
effective_events-2.28.0 app/datatables/admin/effective_events_datatable.rb
effective_events-2.27.0 app/datatables/admin/effective_events_datatable.rb
effective_events-2.26.0 app/datatables/admin/effective_events_datatable.rb