Module: Interage::ApplicationHelper

Constant Summary

Constants included from LinkToHelper

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

Constants included from GravatarHelper

GravatarHelper::BASE_URL

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 CocoonHelper

CocoonHelper::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, #handle_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, #format_date, #format_time

Methods included from CPFHelper

#format_cpf

Methods included from ControllerActiveHelper

#current_controller?, #menu_active, #menu_class_show

Methods included from CocoonHelper

#cocoon_default_btn_class, #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 BootstrapHelper

#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, #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



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

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

#app_nameObject



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

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

#app_page_title(area = '') ⇒ Object



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

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

#devise_page_titleObject



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

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

#env_nameObject



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

def env_name
  ENV['ENV_NAME']
end

#env_name_upcaseObject



56
57
58
# File 'lib/interage/application_helper.rb', line 56

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

#format_seconds(seconds) ⇒ Object



26
27
28
# File 'lib/interage/application_helper.rb', line 26

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

#page_titleObject



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

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

#rails_app_nameObject



50
51
52
53
54
# File 'lib/interage/application_helper.rb', line 50

def rails_app_name
  rails_class = Rails.application.class

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