Sha256: df8cbc02a7aff2e3ba4fafca521497b9b4b4888482fb8dcc8419369e00fc71c7

Contents?: true

Size: 1.11 KB

Versions: 21

Compression:

Stored size: 1.11 KB

Contents

if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
  module Effective
    module Datatables
      class Posts < Effective::Datatable
        datatable do
          default_order :published_at, :desc

          table_column :published_at
          table_column :id, visible: false

          table_column :title
          table_column :category, filter: { type: :select, values: EffectivePosts.categories }

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

            table_column :draft, visible: false
          else
            table_column :draft
          end

          table_column :start_at
          table_column :end_at, visible: false
          table_column :location, visible: false

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

          table_column :actions, sortable: false, filter: false, partial: '/admin/posts/actions'
        end

        def collection
          Effective::Post.all
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
effective_posts-0.6.4 app/models/effective/datatables/posts.rb
effective_posts-0.6.3 app/models/effective/datatables/posts.rb
effective_posts-0.6.2 app/models/effective/datatables/posts.rb
effective_posts-0.6.1 app/models/effective/datatables/posts.rb
effective_posts-0.6.0 app/models/effective/datatables/posts.rb
effective_posts-1.1.2 app/models/effective/datatables/posts.rb
effective_posts-1.1.1 app/models/effective/datatables/posts.rb
effective_posts-1.1.0 app/models/effective/datatables/posts.rb
effective_posts-1.0.6 app/models/effective/datatables/posts.rb
effective_posts-1.0.5 app/models/effective/datatables/posts.rb
effective_posts-1.0.4 app/models/effective/datatables/posts.rb
effective_posts-1.0.3 app/models/effective/datatables/posts.rb
effective_posts-1.0.2 app/models/effective/datatables/posts.rb
effective_posts-1.0.1 app/models/effective/datatables/posts.rb
effective_posts-0.5.10 app/models/effective/datatables/posts.rb
effective_posts-1.0.0 app/models/effective/datatables/posts.rb
effective_posts-0.5.8 app/models/effective/datatables/posts.rb
effective_posts-0.5.7 app/models/effective/datatables/posts.rb
effective_posts-0.5.6 app/models/effective/datatables/posts.rb
effective_posts-0.5.5 app/models/effective/datatables/posts.rb