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

25 lines
460 B
Ruby
Raw Normal View History

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)
namespace_project_tags_path(@project.namespace, @project, @id, options)
end
2015-04-26 12:48:37 +05:30
def tag_list(project)
2014-09-02 18:07:02 +05:30
html = ''
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
html.html_safe
end
end