Module: Monologue::ApplicationHelper

Includes:
HtmlHelper, TagsHelper
Defined in:
app/helpers/monologue/application_helper.rb

Constant Summary

Constants included from TagsHelper

TagsHelper::NUMBER_OF_LABEL_SIZES

Instance Method Summary collapse

Methods included from TagsHelper

#label_for_tag, #size_for_tag, #tag_url

Methods included from HtmlHelper

#activable_li_tag, #activable_li_tag_with_link, #sidebar_section_for

Instance Method Details

#absolute_image_url(url) ⇒ Object



45
46
47
48
# File 'app/helpers/monologue/application_helper.rb', line 45

def absolute_image_url(url)
  return url if url.starts_with? "http"
  request.protocol + request.host + url
end

#facebook_iconObject



41
42
43
# File 'app/helpers/monologue/application_helper.rb', line 41

def facebook_icon
  social_icon("facebook", Monologue::Config.facebook_url, Monologue::Config.facebook_url)
end

#github_iconObject



25
26
27
# File 'app/helpers/monologue/application_helper.rb', line 25

def github_icon
  social_icon("github", "http://github.com/#{Monologue::Config.github_username}", Monologue::Config.github_username)
end

#googleplus_iconObject



37
38
39
# File 'app/helpers/monologue/application_helper.rb', line 37

def googleplus_icon
  social_icon("google-plus", Monologue::Config., Monologue::Config.)
end

#linkedin_iconObject



33
34
35
# File 'app/helpers/monologue/application_helper.rb', line 33

def linkedin_icon
  social_icon("linkedin", Monologue::Config.linkedin_url, Monologue::Config.linkedin_url)
end

#monologue_accurate_titleObject



13
14
15
# File 'app/helpers/monologue/application_helper.rb', line 13

def monologue_accurate_title
  content_for?(:title) ? ((content_for :title) + " | #{Monologue::Config.site_name}") : Monologue::Config.site_name
end

#monologue_admin_form_for(object, options = {}, &block) ⇒ Object



8
9
10
11
# File 'app/helpers/monologue/application_helper.rb', line 8

def monologue_admin_form_for(object, options = {}, &block)
  options[:builder] = MonologueAdminFormBuilder
  form_for(object, options, &block)
end


17
18
19
# File 'app/helpers/monologue/application_helper.rb', line 17

def rss_head_link
  tag("link", href: feed_url, rel: "alternate", title: "RSS", type: "application/rss+xml")
end

#rss_iconObject



21
22
23
# File 'app/helpers/monologue/application_helper.rb', line 21

def rss_icon
  social_icon("rss", feed_url, Monologue::Config.show_rss_icon)
end

#social_icon(foundicon, url, setting) ⇒ Object



50
51
52
53
54
55
56
# File 'app/helpers/monologue/application_helper.rb', line 50

def social_icon(foundicon, url, setting)
  return if setting.nil? || !setting
   :a, href: url, class: "social", target: "_blank" do
     :i, class: "foundicon-#{foundicon}" do # using an empty content tag for foundicons to appear. TODO: try to do otherwise and use only tag method
    end
  end
end

#twitter_iconObject



29
30
31
# File 'app/helpers/monologue/application_helper.rb', line 29

def twitter_icon
  social_icon("twitter", "http://twitter.com/#{Monologue::Config.twitter_username}", Monologue::Config.twitter_username)
end