Module: AvatarHelper
- Defined in:
- app/helpers/avatar_helper.rb
Instance Method Summary collapse
- #avatars_for(user) ⇒ Object
- #locked_avatars_for(user) ⇒ Object
- #show_avatar_item(item, **options) ⇒ Object
- #show_locked_avatar_item(item) ⇒ Object
Instance Method Details
#avatars_for(user) ⇒ Object
2 3 4 |
# File 'app/helpers/avatar_helper.rb', line 2 def avatars_for(user) (Avatar.with_current_audience_for(user) + user.acquired_medals + [user.avatar]).compact.uniq end |
#locked_avatars_for(user) ⇒ Object
6 7 8 |
# File 'app/helpers/avatar_helper.rb', line 6 def locked_avatars_for(user) user.unacquired_medals.compact.uniq end |
#show_avatar_item(item, **options) ⇒ Object
14 15 16 |
# File 'app/helpers/avatar_helper.rb', line 14 def show_avatar_item(item, **) avatar_image(item.image_url, alt: item.description, 'mu-avatar-id': item.id, class: 'mu-avatar-item', type: item.class.name, **) end |
#show_locked_avatar_item(item) ⇒ Object
10 11 12 |
# File 'app/helpers/avatar_helper.rb', line 10 def show_locked_avatar_item(item) show_avatar_item(item, class: 'mu-avatar-item mu-locked') end |