Sha256: e9656138d92a6896f1b99dd6252dc43b42aaebf23ebb7b8f21e487b261fb0d9a

Contents?: true

Size: 1.06 KB

Versions: 20

Compression:

Stored size: 1.06 KB

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, label: cpd_cycle_label.capitalize, 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

      if attributes[:user_id].present?
        col :required_score, label: 'Required' do |cpd_statement|
          cpd_score(cpd_statement.required_score || cpd_statement.targeted_score)
        end
      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-0.6.9 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.2.4 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.2.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.2.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.2.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.2.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.1.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.1.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.1.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.1.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-1.0.0 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.8 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.7 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.6 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.5 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.4 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.3 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.2 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.1 app/datatables/admin/effective_cpd_statements_datatable.rb
effective_cpd-0.6.0 app/datatables/admin/effective_cpd_statements_datatable.rb