-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make the class name optional and use two classes for hiding name of a…
…vatar for tablet and small screen laptop
- Loading branch information
1 parent
b4d31f6
commit 6f39522
Showing
11 changed files
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,8 @@ module AvatarHelper | |
|
||
# Returns the avatar image tag for the given +user+ if avatars are enabled | ||
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <[email protected]>') | ||
def avatar(principal, size: 'default', hide_name: true, classes_for_name: '', **options) | ||
build_principal_avatar_tag principal, size:, hide_name:, classes_for_name:, **options | ||
def avatar(principal, size: 'default', hide_name: true, name_classes: '', **options) | ||
build_principal_avatar_tag principal, size:, hide_name:, name_classes:, **options | ||
rescue StandardError => e | ||
Rails.logger.error "Failed to create avatar for #{principal}: #{e}" | ||
''.html_safe | ||
|
@@ -106,7 +106,7 @@ def build_principal_avatar_tag(user, **options) | |
link: tag_options[:link], | ||
size: tag_options[:size], | ||
hideName: tag_options[:hide_name], | ||
classesForName: tag_options[:classes_for_name], | ||
nameClasses: tag_options[:name_classes], | ||
title: tag_options.fetch(:title, '') | ||
} | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters