Module: TopicsHelper

Includes:
ApplicationHelper
Defined in:
app/helpers/topics_helper.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#add_resource_preload_list, #admin?, #age_words, all_connectors, #allow_plugins?, #allow_third_party_plugins?, #application_logo_dark_url, #application_logo_url, #authentication_data, #body_classes, #build_plugin_html, #can_sign_up?, #category_badge, #client_side_setup_data, #crawlable_meta_data, #crawler_layout?, #current_homepage, #customization_disabled?, #dark_color_scheme?, #dark_scheme_id, #discourse_color_scheme_stylesheets, #discourse_config_environment, #discourse_csrf_tags, #discourse_preload_color_scheme_stylesheets, #discourse_stylesheet_link_tag, #discourse_stylesheet_preload_tag, #discourse_theme_color_meta_tags, #escape_unicode, extra_body_classes, #format_topic_title, #ga_universal_json, #get_absolute_image_url, #google_tag_manager_json, #google_tag_manager_nonce_placeholder, #google_universal_analytics_json, #gsub_emoji_to_unicode, #guardian, #html_classes, #html_lang, #include_crawler_content?, #include_ios_native_app_banner?, #include_splash_screen?, #ios_app_argument, #ios_device?, #is_brotli_req?, #is_gzip_req?, #loading_admin?, #login_path, #manifest_url, #mobile_device?, #mobile_view?, #moderator?, #modern_mobile_device?, #normalized_safe_mode, #preload_script, #preload_script_url, #preloaded_json, #render_sitelinks_search_tag, #replace_plugin_html, #rss_creator, #rtl?, #scheme_id, #script_asset_path, #server_plugin_outlet, #shared_session_key, #short_date, #staff?, #stylesheet_manager, #text_size_class, #theme_id, #theme_js_lookup, #theme_lookup, #theme_translations_lookup, #topic_featured_link_domain, #waving_hand_url, #with_format

Methods included from GlobalPath

#cdn_path, #cdn_relative_path, #full_cdn_url, #path, #upload_cdn_path

Methods included from ConfigurableUrls

#faq_path, #privacy_policy_url, #tos_url

Methods included from CanonicalURL::Helpers

#canonical_link_tag

Methods included from CurrentUser

#clear_current_user, #current_user, has_auth_cookie?, #is_api?, #is_user_api?, #log_off_user, #log_on_user, lookup_from_env, #refresh_session

Instance Method Details

#categories_breadcrumb(topic) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/topics_helper.rb', line 10

def categories_breadcrumb(topic)
  breadcrumb = []
  category = topic.category

  if category && !category.uncategorized?
    breadcrumb.push(url: category.url, name: category.name, color: category.color)
    while category = category.parent_category
      breadcrumb.prepend(url: category.url, name: category.name, color: category.color)
    end
  end

  Plugin::Filter.apply(:topic_categories_breadcrumb, topic, breadcrumb)
end

#render_topic_title(topic) ⇒ Object



6
7
8
# File 'app/helpers/topics_helper.rb', line 6

def render_topic_title(topic)
  link_to(Emoji.gsub_emoji_to_unicode(topic.title), topic.relative_url)
end