debian-mirror-gitlab/app/helpers/tags_helper.rb

32 lines
556 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2014-09-02 18:07:02 +05:30
module TagsHelper
2015-04-26 12:48:37 +05:30
def tag_path(tag)
2014-09-02 18:07:02 +05:30
"/tags/#{tag}"
end
2016-09-29 09:46:39 +05:30
def filter_tags_path(options = {})
exist_opts = {
search: params[:search],
sort: params[:sort]
}
options = exist_opts.merge(options)
2017-09-10 17:25:29 +05:30
project_tags_path(@project, @id, options)
2016-09-29 09:46:39 +05:30
end
2015-04-26 12:48:37 +05:30
def tag_list(project)
2018-12-05 23:21:45 +05:30
html = []
2014-09-02 18:07:02 +05:30
project.tag_list.each do |tag|
2015-04-26 12:48:37 +05:30
html << link_to(tag, tag_path(tag))
2014-09-02 18:07:02 +05:30
end
2018-12-05 23:21:45 +05:30
html.join.html_safe
2014-09-02 18:07:02 +05:30
end
2017-08-17 22:00:37 +05:30
def protected_tag?(project, tag)
ProtectedTag.protected?(project, tag.name)
end
2014-09-02 18:07:02 +05:30
end