2011-11-07 11:40:22 +00:00
|
|
|
module TagsHelper
|
2014-09-25 22:07:40 +00:00
|
|
|
def tag_path(tag)
|
2011-11-09 19:26:24 +00:00
|
|
|
"/tags/#{tag}"
|
|
|
|
end
|
2011-11-07 17:48:58 +00:00
|
|
|
|
2016-08-31 10:39:35 +00:00
|
|
|
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
|
|
|
|
|
2014-09-25 22:07:40 +00:00
|
|
|
def tag_list(project)
|
2011-11-09 19:26:24 +00:00
|
|
|
html = ''
|
|
|
|
project.tag_list.each do |tag|
|
2014-10-09 07:47:47 +00:00
|
|
|
html << link_to(tag, tag_path(tag))
|
2011-11-09 19:26:24 +00:00
|
|
|
end
|
2011-11-07 17:48:58 +00:00
|
|
|
|
2011-11-09 19:26:24 +00:00
|
|
|
html.html_safe
|
|
|
|
end
|
2011-11-07 11:40:22 +00:00
|
|
|
end
|