Module: TagsHelper

Defined in:
app/helpers/tags_helper.rb

Instance Method Summary collapse

Instance Method Details

#filter_tags_path(options = {}) ⇒ Object



8
9
10
# File 'app/helpers/tags_helper.rb', line 8

def filter_tags_path(options = {})
  project_tags_path(@project, @id, options)
end

#protected_tag?(project, tag) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/helpers/tags_helper.rb', line 12

def protected_tag?(project, tag)
  ProtectedTag.protected?(project, tag.name)
end

#tag_description_help_textObject



16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/tags_helper.rb', line 16

def tag_description_help_text
  text = s_('TagsPage|Optionally, add a message to the tag. Leaving this blank creates '\
    'a %{link_start}lightweight tag.%{link_end}') % {
      link_start: '<a href="https://git-scm.com/book/en/v2/Git-Basics-Tagging" ' \
        'target="_blank" rel="noopener noreferrer">',
      link_end: '</a>'
    }

  text.html_safe
end

#tag_path(tag) ⇒ Object



4
5
6
# File 'app/helpers/tags_helper.rb', line 4

def tag_path(tag)
  "/tags/#{tag}"
end

#tag_view_signature(tag) ⇒ Object



27
28
29
30
31
# File 'app/helpers/tags_helper.rb', line 27

def tag_view_signature(tag)
  return tag.lazy_cached_signature if tag.can_use_lazy_cached_signature?

  tag.signature
end