Sha256: 4547b877dcda57c44bfbdba8fdaea2e278c5f0bbaff906e86fd5d63f97c724ec

Contents?: true

Size: 1009 Bytes

Versions: 20

Compression:

Stored size: 1009 Bytes

Contents

module Admin
  class EffectiveCpdStatementsDatatable < Effective::Datatable
    filters do
      scope :all
      scope :draft, label: 'In Progress'
      scope :completed, label: 'Submitted'
    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, search: Effective::CpdCycle.sorted
      col :user
      col :submitted_at, as: :date, label: 'Submitted on'

      col :score, label: cpd_credits_label.capitalize do |cpd_statement|
        cpd_score(cpd_statement.score)
      end

      col :target_score, label: "Required " + cpd_credits_label.capitalize, as: :decimal do |cpd_statement|
        cpd_score(cpd_statement.target_score)
      end

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

      actions_col
    end

    collection do
      EffectiveCpd.CpdStatement.all.deep
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
effective_cpd-1.7.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.7.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.7.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.5 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.4 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.6.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.5.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.5.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.8 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.7 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.6 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.5 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.4 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.4.0 app/datatables/admin/effective_cpd_statements_datatable.rb