Sha256: 9ec903a12e55d35f17ad40fe7d7256f172c7a7a50a527618681c37052f9d75b8

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

module Admin
  class EffectiveClassifiedsDatatable < Effective::Datatable
    filters do
      scope :all

      unless EffectiveClassifieds.auto_approve
        scope :submitted
        scope :approved
      end

      scope :draft
      scope :published
    end

    datatable do
      order :start_on

      col :updated_at, visible: false
      col :created_at, visible: false

      col :id, visible: false

      col :classified_wizard, visible: false, search: :string
      col :owner, visible: false, label: 'Submitted by'

      col :start_on, as: :date
      col :end_on, as: :date

      if categories.present?
        col :category, search: categories
      end

      col :title
      col :body, visible: false
      col :slug, visible: false

      col :organization
      col :location

      col :website
      col :email
      col :phone

      col :status
      col :archived

      col :status

      col :purchased_order, visible: false

      actions_col do |classified|
        dropdown_link_to('View Classified', effective_classifieds.classified_path(classified), target: '_blank')
      end
    end

    collection do
      Effective::Classified.all
    end

    def categories
      EffectiveClassifieds.categories
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_classifieds-0.4.13 app/datatables/admin/effective_classifieds_datatable.rb
effective_classifieds-0.4.12 app/datatables/admin/effective_classifieds_datatable.rb
effective_classifieds-0.4.11 app/datatables/admin/effective_classifieds_datatable.rb
effective_classifieds-0.4.10 app/datatables/admin/effective_classifieds_datatable.rb
effective_classifieds-0.4.9 app/datatables/admin/effective_classifieds_datatable.rb