Module: Crm::ContactTrainingTopicsHelper
- Defined in:
- app/helpers/crm/contact_training_topics_helper.rb
Overview
View helpers for the contact training topics UI: renders a badge icon
reflecting a contact's training state on a topic.
Instance Method Summary collapse
-
#contact_training_topic_badge(state) ⇒ ActiveSupport::SafeBuffer?
Renders a Font Awesome badge icon for a contact's training state (
reviewed→ green thumbs-up,certified→ gold certificate).
Instance Method Details
#contact_training_topic_badge(state) ⇒ ActiveSupport::SafeBuffer?
Renders a Font Awesome badge icon for a contact's training state
(reviewed → green thumbs-up, certified → gold certificate).
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/crm/contact_training_topics_helper.rb', line 15 def contact_training_topic_badge(state) return unless state icon_map = { reviewed: { icon: 'thumbs-o-up', style: 'color: green' }, certified: { icon: 'certificate', style: 'color: gold' } } return unless (badge_data = icon_map[state.to_sym]) fa_icon(badge_data[:icon], style: badge_data[:style]) end |