Sha256: 9140e3a840c9fac88c673b6781dbba7b346ed62ce459cf58d83c7e9a6709f394

Contents?: true

Size: 576 Bytes

Versions: 2

Compression:

Stored size: 576 Bytes

Contents

module AuthorsHelper
  include BlogHelper

  def display_profile_item(item, item_desc)
    return if item.blank?
    item = link_to(item, item) if is_url?(item)
    content_tag :li do
      safe_join([item_desc, item], ' ')
    end
  end

  def is_url?(str)
    [URI::HTTP, URI::HTTPS].include?(URI.parse(str.to_s).class)
  rescue URI::InvalidURIError
    false
  end

  def author_description(user)
    return if user.description.blank?

    content_tag(:div, user.description, id: 'author-description')
  end

  def author_link(article)
    h(article.author_name)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
publify_core-9.1.0 app/helpers/authors_helper.rb
publify_core-9.0.1 app/helpers/authors_helper.rb