Sha256: 2ddbc363207313570915fb8da1321ae6c0f5cb630dcc2409f9a95b0d4ba646a4

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

module HelpCenter::SupportPostsHelper
  # Override this to use avatars from other places than Gravatar
  def avatar_tag(email)
    gravatar_image_tag(email, gravatar: { size: 40 }, class: "rounded avatar")
  end

  def support_category_link(category)
    link_to category.name, help_center.support_category_path(category),
      style: "color: #{category.color}"
  end

  # Override this method to provide your own content formatting like Markdown
  def formatted_content(text)
    simple_format(text)
  end

  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

  def support_user_badge(user)
    if user.respond_to?(:moderator) && user.moderator?
      content_tag :span, "Mod", class: "badge badge-default"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
help_center-0.1.0 app/helpers/help_center/support_posts_helper.rb
help_center-0.0.9 app/helpers/help_center/support_posts_helper.rb
help_center-0.0.8 app/helpers/help_center/support_posts_helper.rb
help_center-0.0.7 app/helpers/help_center/support_posts_helper.rb
help_center-0.0.6 app/helpers/help_center/support_posts_helper.rb