Sha256: 9f669f25d2511b8bdc064980b539732080f2ad1df9f50a33eca4ac6e67357750

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module AdditionalTagsWikiHelper
  def sidebar_tags
    unless @sidebar_tags
      @sidebar_tags = []
      @sidebar_tags = WikiPage.available_tags project: @project if AdditionalTags.show_sidebar_tags?
    end
    @sidebar_tags
  end

  def render_sidebar_tags
    options = { link_wiki_tag: true,
                project: @project }

    render_tags_list sidebar_tags, **options
  end

  def render_wiki_index_title(title, project: nil, name: nil, tag: nil)
    title = l title unless is_a? Symbol

    if tag.present?
      tag_object = ActsAsTaggableOn::Tag.new name: tag

      if project
        safe_join [l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' '
      else
        items = [link_to(title, wiki_index_path)]
        items << safe_join([l(:label_wiki_index_for_tag), additional_tag_link(tag_object, link: '#')], ' ')
        render_breadcrumb items
      end
    elsif name.present?
      render_breadcrumb [link_to(title, wiki_index_path),
                         name]
    else
      title
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
additional_tags-3.4.0 app/helpers/additional_tags_wiki_helper.rb
additional_tags-3.3.2 app/helpers/additional_tags_wiki_helper.rb
additional_tags-3.3.1 app/helpers/additional_tags_wiki_helper.rb