Module: HelpCenter::SupportPostsHelper
- Defined in:
- app/helpers/help_center/support_posts_helper.rb
Instance Method Summary collapse
-
#avatar_tag(email) ⇒ Object
Override this to use avatars from other places than Gravatar.
-
#formatted_content(text) ⇒ Object
Override this method to provide your own content formatting like Markdown.
- #support_category_link(category) ⇒ Object
- #support_post_classes(support_post) ⇒ Object
- #support_user_badge(user) ⇒ Object
Instance Method Details
#avatar_tag(email) ⇒ Object
Override this to use avatars from other places than Gravatar
3 4 5 |
# File 'app/helpers/help_center/support_posts_helper.rb', line 3 def avatar_tag(email) gravatar_image_tag(email, gravatar: { size: 40 }, class: "rounded avatar") end |
#formatted_content(text) ⇒ Object
Override this method to provide your own content formatting like Markdown
13 14 15 |
# File 'app/helpers/help_center/support_posts_helper.rb', line 13 def formatted_content(text) simple_format(text) end |
#support_category_link(category) ⇒ Object
7 8 9 10 |
# File 'app/helpers/help_center/support_posts_helper.rb', line 7 def support_category_link(category) link_to category.name, help_center.support_category_path(category), style: "color: #{category.color}" end |
#support_post_classes(support_post) ⇒ Object
17 18 19 20 21 22 |
# File 'app/helpers/help_center/support_posts_helper.rb', line 17 def support_post_classes(support_post) klasses = ["support-post", "card", "mb-3"] klasses << "solved" if support_post.solved? klasses << "original-poster" if support_post.user == @support_thread.user klasses end |
#support_user_badge(user) ⇒ Object
24 25 26 27 28 |
# File 'app/helpers/help_center/support_posts_helper.rb', line 24 def support_user_badge(user) if user.respond_to?(:moderator) && user.moderator? content_tag :span, "Mod", class: "badge badge-default" end end |