Sha256: 5e5a542ea1d2617ba3879eff0a7773076a04fd76a55006093eff3e47582e2672

Contents?: true

Size: 731 Bytes

Versions: 12

Compression:

Stored size: 731 Bytes

Contents

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
effective_posts-0.7.1 app/datatables/effective_posts_datatable.rb
effective_posts-0.7.0 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.2 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.1 app/datatables/effective_posts_datatable.rb
effective_posts-1.1.0 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.6 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.5 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.4 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.3 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.2 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.1 app/datatables/effective_posts_datatable.rb
effective_posts-1.0.0 app/datatables/effective_posts_datatable.rb