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)
|
2017-06-29 17:06:35 +00:00
|
|
|
project_tags_path(@project, @id, options)
|
2016-08-31 10:39:35 +00:00
|
|
|
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
|
2017-03-31 18:30:33 +00:00
|
|
|
|
|
|
|
def protected_tag?(project, tag)
|
2017-04-03 17:59:58 +00:00
|
|
|
ProtectedTag.protected?(project, tag.name)
|
2017-03-31 18:30:33 +00:00
|
|
|
end
|
2011-11-07 11:40:22 +00:00
|
|
|
end
|