Sha256: 87e1edb6ff5a526c7cb00fc6d8395d8865590a7b7369b2381679e74e6d7eb1e1

Contents?: true

Size: 1.3 KB

Versions: 27

Compression:

Stored size: 1.3 KB

Contents

class Admin::EffectiveEventNotificationsDatatable < Effective::Datatable
  # filters do
  #   scope :all
  #   scope :started
  #   scope :completed
  # end

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

    col :event
    col :category

    col :from do |event|
      simple_format(event.from)
    end

    # col :reminder do |poll_notification|
    #   case poll_notification.category
    #   when 'When poll starts'
    #     poll_notification.poll.start_at&.strftime('%F %H:%M')
    #   when 'When poll ends'
    #     poll_notification.poll.end_at&.strftime('%F %H:%M')
    #   when 'Upcoming reminder'
    #     Effective::PollNotification::UPCOMING_REMINDERS.invert[poll_notification.reminder]
    #   when 'Reminder'
    #     Effective::PollNotification::REMINDERS.invert[poll_notification.reminder]
    #   when 'Before poll ends'
    #     Effective::PollNotification::UPCOMING_REMINDERS.invert[poll_notification.reminder]
    #   else
    #     raise('unexpected category')
    #   end
    # end

    col :subject

    col :body do |notification|
      simple_format(notification.body)
    end

    # col :started_at, visible: false
    # col :completed_at

    actions_col
  end

  collection do
    Effective::EventNotification.all.deep
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
effective_events-0.7.4 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.7.3 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.7.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.7.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.7.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.13 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.12 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.11 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.10 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.9 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.8 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.7 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.6 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.5 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.4 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.3 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.6.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.5.6 app/datatables/admin/effective_event_notifications_datatable.rb