Module: AdditionalTagsWikiHelper

Defined in:
app/helpers/additional_tags_wiki_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_sidebar_tagsObject



12
13
14
15
16
17
# File 'app/helpers/additional_tags_wiki_helper.rb', line 12

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

  render_tags_list sidebar_tags, **options
end

#render_wiki_index_title(title, project: nil, name: nil, tag: nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/helpers/additional_tags_wiki_helper.rb', line 19

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


4
5
6
7
8
9
10
# File 'app/helpers/additional_tags_wiki_helper.rb', line 4

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