summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-09-14 00:33:05 +0000
committerGo MAEDA <maeda@farend.jp>2019-09-14 00:33:05 +0000
commit0d4fbfe3405494a8c6e7ef2ec91dacc2f145a4a3 (patch)
treeed256bb1f9793235fe125a1a0ea416f2565ee64e /app
parent81d6e24a8fca881aa9d2e6adbe31c9738b37a527 (diff)
downloadredmine-0d4fbfe3405494a8c6e7ef2ec91dacc2f145a4a3.tar.gz
redmine-0d4fbfe3405494a8c6e7ef2ec91dacc2f145a4a3.zip
Add clear query icon next to selected query in sidebar (#31640).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18468 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/queries_helper.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index e08dd3003..55b7d5812 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -392,13 +392,21 @@ module QueriesHelper
content_tag('ul',
queries.collect {|query|
css = +'query'
- css << ' selected' if query == @query
- content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css))
+ clear_link = +''
+ if query == @query
+ css << ' selected'
+ clear_link += link_to_clear_query
+ end
+ content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css) + clear_link.html_safe)
}.join("\n").html_safe,
:class => 'queries'
) + "\n"
end
+ def link_to_clear_query
+ link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon-only icon-clear-query', :title => l(:button_clear)
+ end
+
# Renders the list of queries for the sidebar
def render_sidebar_queries(klass, project)
queries = sidebar_queries(klass, project)