Sha256: fa6df7c965077f640ea3ad4122f19c4074bc6aad4908c5e9726db10cca44fe42

Contents?: true

Size: 779 Bytes

Versions: 10

Compression:

Stored size: 779 Bytes

Contents

module Admin
  class EffectiveCpdStatementsDatatable < Effective::Datatable
    filters do
      scope :all
      scope :draft, label: 'In Progress'
      scope :completed
    end

    datatable do
      order :updated_at

      col :id, visible: false
      col :token, visible: false
      col :created_at, visible: false
      col :updated_at, visible: false

      col :cpd_cycle, label: cpd_cycle_label.titleize
      col :user
      col :submitted_at, as: :date, label: 'Submitted'

      col :score do |cpd_statement|
        cpd_score(cpd_statement.score)
      end

      col :carry_forward do |cpd_statement|
        cpd_score(cpd_statement.carry_forward)
      end

      actions_col
    end

    collection do
      Effective::CpdStatement.all.deep
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
effective_cpd-0.4.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.4.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.4.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.4.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.3.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.3.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.3.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.3.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.2.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.2.0 app/datatables/admin/effective_cpd_statements_datatable.rb