mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 17:26:06 +01:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -94,6 +94,8 @@ div#wrapper, div#wrapper2, div#wrapper3 { min-height: inherit; }
|
||||
#sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
|
||||
#sidebar div.wiki ul {margin:inherit; padding-left:40px;}
|
||||
#sidebar div.wiki ul li {list-style-type:inherit;}
|
||||
#sidebar a.icon-only {opacity: 0.4; margin-left: 5px;}
|
||||
#sidebar a.icon-only:hover {opacity: 1;}
|
||||
|
||||
#content { flex-grow: 1; background-color: #fff; margin: 0px; padding: 6px 10px 10px 10px; overflow-x: auto;}
|
||||
html>body #content { min-height: 600px; }
|
||||
@@ -406,8 +408,6 @@ body.controller-issues .query-totals {margin-top:-2.3em;}
|
||||
td.center {text-align:center;}
|
||||
|
||||
#watchers select {width: 95%; display: block;}
|
||||
#watchers a.delete {opacity: 0.4; margin-left: 5px;}
|
||||
#watchers a.delete:hover {opacity: 1;}
|
||||
#watchers img.gravatar {margin: 0 4px 2px 0;}
|
||||
|
||||
span#watchers_inputs {overflow:auto; display:block;}
|
||||
@@ -1515,6 +1515,7 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
|
||||
.icon-sorted-desc { background-image: url(../images/arrow_up.png); }
|
||||
.icon-toggle-plus { background-image: url(../images/bullet_toggle_plus.png) }
|
||||
.icon-toggle-minus { background-image: url(../images/bullet_toggle_minus.png) }
|
||||
.icon-clear-query { background-image: url(../images/close_hl.png); }
|
||||
|
||||
.icon-file { background-image: url(../images/files/default.png); }
|
||||
.icon-file.text-plain { background-image: url(../images/files/text.png); }
|
||||
|
||||
@@ -292,6 +292,17 @@ class IssuesControllerTest < Redmine::ControllerTest
|
||||
:query_id => 5
|
||||
}
|
||||
assert_response :success
|
||||
|
||||
assert_select '#sidebar .queries' do
|
||||
# assert only query is selected in sidebar
|
||||
assert_select 'a.query.selected', 1
|
||||
# assert link properties
|
||||
assert_select 'a.query.selected[href=?]', '/projects/ecookbook/issues?query_id=5', :text => "Open issues by priority and tracker"
|
||||
# assert only one clear link exists
|
||||
assert_select 'a.icon-clear-query', 1
|
||||
# assert clear link properties
|
||||
assert_select 'a.icon-clear-query[title=?][href=?]', 'Clear', '/projects/ecookbook/issues?set_filter=1&sort=', 1
|
||||
end
|
||||
end
|
||||
|
||||
def test_index_with_query_grouped_by_tracker
|
||||
|
||||
Reference in New Issue
Block a user