Module: EffectiveCpdAuditsHelper
- Defined in:
- app/helpers/effective_cpd_audits_helper.rb
Instance Method Summary collapse
- #cpd_audit_conflict_of_interest_collection ⇒ Object
- #cpd_audit_exemption_request_collection ⇒ Object
- #cpd_audit_extension_request_collection ⇒ Object
- #cpd_audit_new_reviewer_collection(cpd_audit = nil) ⇒ Object
Instance Method Details
#cpd_audit_conflict_of_interest_collection ⇒ Object
3 4 5 |
# File 'app/helpers/effective_cpd_audits_helper.rb', line 3 def cpd_audit_conflict_of_interest_collection [['Yes, there is a conflict of interest', true], ['No conflict of interest', false]] end |
#cpd_audit_exemption_request_collection ⇒ Object
7 8 9 |
# File 'app/helpers/effective_cpd_audits_helper.rb', line 7 def cpd_audit_exemption_request_collection [['Yes, I would like to request an exemption', true], ['No exemption request', false]] end |
#cpd_audit_extension_request_collection ⇒ Object
11 12 13 |
# File 'app/helpers/effective_cpd_audits_helper.rb', line 11 def cpd_audit_extension_request_collection [['Yes, I would like to request an extension', true], ['No extension request', false]] end |
#cpd_audit_new_reviewer_collection(cpd_audit = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/effective_cpd_audits_helper.rb', line 15 def cpd_audit_new_reviewer_collection(cpd_audit = nil) cpd_audit ||= EffectiveCpd.CpdAudit.new raise('expected a cpd audit') unless cpd_audit.class.respond_to?(:effective_cpd_audit?) cpd_audit.current_user = current_user users = cpd_audit.suggested_cpd_audit_reviewers() users.map do |user| in_progress = content_tag(:span, class: 'badge badge-info') do user.cpd_audit_reviews.count { |review| review.in_progress? }.to_s + ' in progress' end html = content_tag(:div, "#{user} #{in_progress}") [user.to_s, user.to_param, { 'data-html': html }] end end |