Sha256: f2b0349f8f0114fc6f5e3c83266641121da488f1ccde7282b4727e31bf266c50

Contents?: true

Size: 761 Bytes

Versions: 10

Compression:

Stored size: 761 Bytes

Contents

class EffectivePostsDatatable < Effective::Datatable
  datatable do
    order :published_at, :desc

    col :published_at
    col :id, visible: false

    col :title
    col :slug, visible: false
    col :category, search: { collection: EffectivePosts.categories }

    if EffectivePosts.submissions_enabled
      col :approved, sql_column: 'NOT(draft)', as: :boolean do |post|
        post.draft? ? 'No' : 'Yes'
      end

      col :draft, visible: false
    else
      col :draft
    end

    col :start_at
    col :end_at, visible: false
    col :location, visible: false

    col :created_at, label: 'Submitted at', visible: false

    actions_col partial: '/admin/posts/actions', partial_as: :post
  end

  collection do
    Effective::Post.all
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
effective_posts-1.2.0 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.11 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.10 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.9 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.8 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.7 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.6 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.5 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.4 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.3 app/datatables/effective_posts_datatable.rb