# HG changeset patch # User luisf # Date 1320761707 0 # Node ID 2ced577501578269f1f92bd52f594ed84dd1a041 # Parent 4acfc770e79f5cffdf15add2982ea762508bf6be The project available tags now accepts the "name_like" parameter. diff -r 4acfc770e79f -r 2ced57750157 vendor/plugins/redmine_tags/app/views/projects/_tags.html.erb --- a/vendor/plugins/redmine_tags/app/views/projects/_tags.html.erb Tue Nov 08 11:37:37 2011 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/_tags.html.erb Tue Nov 08 14:15:07 2011 +0000 @@ -1,4 +1,4 @@ -<% unless project.tag_list.empty? %> +<% unless @project.tag_list.empty? %> <%=l(:tags)%>: <%= project.tag_counts.collect{ |t| render_tag_link(t, :show_count => false, :open_only => false) }.join(', ') %> diff -r 4acfc770e79f -r 2ced57750157 vendor/plugins/redmine_tags/config/locales/en.yml --- a/vendor/plugins/redmine_tags/config/locales/en.yml Tue Nov 08 11:37:37 2011 +0000 +++ b/vendor/plugins/redmine_tags/config/locales/en.yml Tue Nov 08 14:15:07 2011 +0000 @@ -33,3 +33,5 @@ issue_tags_sidebar_cloud: Cloud auto_complete_new_tag: Add new... + + project_filtering_q_label: "Textual search" diff -r 4acfc770e79f -r 2ced57750157 vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb --- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb Tue Nov 08 11:37:37 2011 +0000 +++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb Tue Nov 08 14:15:07 2011 +0000 @@ -35,7 +35,7 @@ def project_tags @name = params[:q].to_s - @tags = Project.available_tags :project_id => @project, :name_like => @name + @tags = Project.available_tags :name_like => @name render :layout => false, :partial => 'tag_list' end end diff -r 4acfc770e79f -r 2ced57750157 vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb --- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Tue Nov 08 11:37:37 2011 +0000 +++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Tue Nov 08 14:15:07 2011 +0000 @@ -59,12 +59,20 @@ # Returns available project tags # does not show tags from private projects - def available_tags + def available_tags( options = {} ) + + name_like = options[:name_like] options = {} visible = ARCondition.new visible << ["#{Project.table_name}.is_public = \"1\""] + + if name_like + visible << ["#{ActsAsTaggableOn::Tag.table_name}.name LIKE ?", "%#{name_like.downcase}%"] + end + options[:conditions] = visible.conditions + self.all_tag_counts(options) end end