Sha256: 41de8eb41b04dfd3d46070944aef6a6ebf06693b43f2b44c5024340f300e1a40

Contents?: true

Size: 589 Bytes

Versions: 11

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

module AuthorsHelper
  include BlogHelper

  def display_profile_item(item, item_desc)
    return if item.blank?

    item = link_to(item, item) if is_url?(item)
    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?

    tag.div(user.description, id: "author-description")
  end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
publify_core-9.2.10 app/helpers/authors_helper.rb
publify_core-9.2.9 app/helpers/authors_helper.rb
publify_core-9.2.8 app/helpers/authors_helper.rb
publify_core-9.2.7 app/helpers/authors_helper.rb
publify_core-9.2.6 app/helpers/authors_helper.rb
publify_core-9.2.5 app/helpers/authors_helper.rb
publify_core-9.2.4 app/helpers/authors_helper.rb
publify_core-9.2.3 app/helpers/authors_helper.rb
publify_core-9.2.2 app/helpers/authors_helper.rb
publify_core-9.2.1 app/helpers/authors_helper.rb
publify_core-9.2.0 app/helpers/authors_helper.rb