Module: Interage::ApplicationHelper

Constant Summary

Constants included from MaterialDesignIconsHelper

MaterialDesignIconsHelper::MD_ICON_TEXT_CLASS

Constants included from LinkToHelper

LinkToHelper::ASIDE_DEFAULT_CLASS, LinkToHelper::DESTROY_CONFIRM_MESSAGE, LinkToHelper::NEW_BUTTON_CLASS, LinkToHelper::PREFIX_BUTTON_CLASS

Constants included from GravatarHelper

GravatarHelper::BASE_URL

Constants included from FontAwesomeHelper

FontAwesomeHelper::FA_ICON_TEXT_CLASS

Constants included from FlashMessageHelper

FlashMessageHelper::ALIAS_TYPES

Constants included from FaviconHelper

FaviconHelper::EXTENTION, FaviconHelper::FAVICON_SIZES, FaviconHelper::FILE_NAME

Constants included from ControllerActiveHelper

ControllerActiveHelper::HTML_ACTIVE_CLASS, ControllerActiveHelper::HTML_SHOW_CLASS

Constants included from BootstrapGridHelper

BootstrapGridHelper::BS_COLUMNS_CLASSES

Constants included from BootstrapButtonHelper

BootstrapButtonHelper::DEFAULT_BTN_CLASS

Constants included from ApplicationIconHelper

Interage::ApplicationIconHelper::ALLOWED_FONT_ICONS, Interage::ApplicationIconHelper::DEFAULT_FONT_ICON

Instance Method Summary collapse

Methods included from VersionHelper

#app_text_version, #app_version, #file_version_exist?

Methods included from TranslationHelper

#translate_boolean, #translate_boolean_in_check_box_icon, #translate_boolean_in_icon, #translate_model_attribute, #translate_model_name, #translate_model_name_pluralized

Methods included from TextHelper

#nl2br

Methods included from PhoneHelper

#format_phone

Methods included from PaginationHelper

#pagination_links

Methods included from NumberHelper

#default_currency_format, #only_numbers

Methods included from MaterialDesignIconsHelper

#md_classes, #md_icon, #md_icon_text

Methods included from LinkToHelper

#aside_link_to, #button_class, #destroy_confirm_message, #link_to_back, #link_to_default, #link_to_destroy, #link_to_edit, #link_to_modal, #link_to_new, #link_to_show

Methods included from GravatarHelper

#gravatar_image_tag

Methods included from FontAwesomeHelper

#fa_classes, #fa_fw_icon, #fa_icon, #fa_icon_text, #fa_icons

Methods included from FlashMessageHelper

#flash_messages, #flashes, #handler_message, #handler_type

Methods included from FaviconHelper

#favicon_link_tags, #favicon_options, #favicon_size_link_tags, #handler_name, #handler_size

Methods included from DateTimeHelper

#business_day?, #business_days_from_now, #current_day, #current_day_name, #current_month, #current_month_name, #current_month_year, #current_year, #format_date, #format_datetime, #format_time, #month_name

Methods included from CPFHelper

#format_cpf

Methods included from ControllerActiveHelper

#action_class_active, #controller_class_active, #controller_class_active_show, #controller_class_show, #current_action?, #current_controller?

Methods included from CocoonHelper

#cocoon_link_to_add_association, #cocoon_link_to_remove_association

Methods included from CNPJHelper

#format_cnpj

Methods included from CEPHelper

#format_cep

Methods included from BootstrapGridHelper

#bs_columns

Methods included from BootstrapButtonHelper

#bootstrap_default_btn_class

Methods included from BootstrapBadgeHelper

#bootstrap_badge, #bs_badge_danger, #bs_badge_dark, #bs_badge_default, #bs_badge_info, #bs_badge_light, #bs_badge_primary, #bs_badge_secondary, #bs_badge_success, #bs_badge_warning

Methods included from BootstrapAlertHelper

#bootstrap_alert, #bootstrap_alert_danger, #bootstrap_alert_default, #bootstrap_alert_info, #bootstrap_alert_not_found, #bootstrap_alert_not_found_female, #bootstrap_alert_not_found_male, #bootstrap_alert_success, #bootstrap_alert_warning, #default_not_found, #text_not_found, #text_not_found_female, #text_not_found_male

Methods included from ApplicationIconHelper

#app_icon, #app_icon_classes, #app_icon_text, #execute_method

Instance Method Details

#admin_page_titleObject



37
38
39
# File 'lib/interage/application_helper.rb', line 37

def admin_page_title
  app_page_title(ENV['PREFIX_ADMIN_PAGE_TITLE'])
end

#app_nameObject



49
50
51
# File 'lib/interage/application_helper.rb', line 49

def app_name
  raw ENV.fetch('APP_NAME', t('application.name', default: rails_app_name))
end

#app_page_title(area = '') ⇒ Object



33
34
35
# File 'lib/interage/application_helper.rb', line 33

def app_page_title(area = '')
  strip_tags "#{env_name_upcase}#{page_title}#{area}#{app_name}"
end

#devise_page_titleObject



41
42
43
# File 'lib/interage/application_helper.rb', line 41

def devise_page_title
  app_page_title(ENV['PREFIX_DEVISE_PAGE_TITLE'])
end

#env_nameObject



63
64
65
# File 'lib/interage/application_helper.rb', line 63

def env_name
  ENV['ENV_NAME']
end

#env_name_upcaseObject



59
60
61
# File 'lib/interage/application_helper.rb', line 59

def env_name_upcase
  "[#{env_name.upcase}] " if env_name.present?
end

#format_seconds(seconds) ⇒ Object



29
30
31
# File 'lib/interage/application_helper.rb', line 29

def format_seconds(seconds)
  t('time.seconds.short', count: seconds)
end

#page_titleObject



45
46
47
# File 'lib/interage/application_helper.rb', line 45

def page_title
  content_for?(:page_title) ? "#{content_for(:page_title)} » " : ''
end

#rails_app_nameObject



53
54
55
56
57
# File 'lib/interage/application_helper.rb', line 53

def rails_app_name
  rails_class = Rails.application.class

  rails_class.try(:module_parent_name) || rails_class.parent_name
end