Sha256: 025fd6158db869a781d7430d383a46f7485568cb5b55ee37b9f0e53ec227a513

Contents?: true

Size: 1.43 KB

Versions: 38

Compression:

Stored size: 1.43 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, visible: false do |notification|
      ERB::Util.html_escape_once(notification.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 :cc, visible: false
    col :bcc, visible: false
    col :content_type, visible: false

    col :started_at, visible: false
    col :completed_at

    actions_col
  end

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

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
effective_events-2.29.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.29.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.29.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.28.3 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.28.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.28.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.28.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.27.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.26.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.25.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-2.25.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.24.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.23.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.23.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.22.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.22.1 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.22.0 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.21.3 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.21.2 app/datatables/admin/effective_event_notifications_datatable.rb
effective_events-0.21.1 app/datatables/admin/effective_event_notifications_datatable.rb