Sha256: 9b408cf09e610cb2c3af3928a6adf648db0a72fce66825b6e61e759ad52a1d83

Contents?: true

Size: 865 Bytes

Versions: 11

Compression:

Stored size: 865 Bytes

Contents

unless Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
  class EffectivePostsDatatable < Effective::Datatable
    datatable do
      order :published_at, :desc

      col :published_at
      col :id, visible: false

      col :title
      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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
effective_posts-0.6.4 app/datatables/effective_posts_datatable.rb
effective_posts-0.6.3 app/datatables/effective_posts_datatable.rb
effective_posts-0.6.2 app/datatables/effective_posts_datatable.rb
effective_posts-0.6.1 app/datatables/effective_posts_datatable.rb
effective_posts-0.6.0 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.10 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.8 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.7 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.6 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.5 app/datatables/effective_posts_datatable.rb
effective_posts-0.5.4 app/datatables/effective_posts_datatable.rb