Project

General

Profile

Patch #31640 » 31640-close_hl.patch

Go MAEDA, 2019-09-12 04:39

View differences:

app/helpers/queries_helper.rb
392 392
      content_tag('ul',
393 393
        queries.collect {|query|
394 394
            css = +'query'
395
            css << ' selected' if query == @query
396
            content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css))
395
            clear_link = +''
396
            if query == @query
397
              css << ' selected'
398
              clear_link += link_to_clear_query
399
            end
400
            content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css) + clear_link.html_safe)
397 401
          }.join("\n").html_safe,
398 402
        :class => 'queries'
399 403
      ) + "\n"
400 404
  end
401 405

  
406
  def link_to_clear_query
407
    link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon-only icon-close-query', :title => l(:button_clear)
408
  end
409

  
402 410
  # Renders the list of queries for the sidebar
403 411
  def render_sidebar_queries(klass, project)
404 412
    queries = sidebar_queries(klass, project)
public/stylesheets/application.css
94 94
#sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
95 95
#sidebar div.wiki ul {margin:inherit; padding-left:40px;}
96 96
#sidebar div.wiki ul li {list-style-type:inherit;}
97
#sidebar a.icon-only {opacity: 0.4; margin-left: 5px;}
98
#sidebar a.icon-only:hover {opacity: 1;}
97 99

  
98 100
#content { flex-grow: 1; background-color: #fff; margin: 0px; padding: 6px 10px 10px 10px; overflow-x: auto;}
99 101
html>body #content { min-height: 600px; }
......
406 408
td.center {text-align:center;}
407 409

  
408 410
#watchers select {width: 95%; display: block;}
409
#watchers a.delete {opacity: 0.4; margin-left: 5px;}
410
#watchers a.delete:hover {opacity: 1;}
411 411
#watchers img.gravatar {margin: 0 4px 2px 0;}
412 412

  
413 413
span#watchers_inputs {overflow:auto; display:block;}
......
1487 1487
.icon-list { background-image: url(../images/text_list_bullets.png); }
1488 1488
.icon-close { background-image: url(../images/close.png); }
1489 1489
.icon-close:hover { background-image: url(../images/close_hl.png); }
1490
.icon-close-query { background-image: url(../images/close_hl.png); }
1490 1491
.icon-settings { background-image: url(../images/changeset.png); }
1491 1492
.icon-group, .icon-groupnonmember, .icon-groupanonymous { background-image: url(../images/group.png); }
1492 1493
.icon-roles { background-image: url(../images/database_key.png); }
test/functional/issues_controller_test.rb
292 292
        :query_id => 5
293 293
      }
294 294
    assert_response :success
295

  
296
    assert_select '#sidebar .queries' do
297
      # assert only query is selected in sidebar
298
      assert_select 'a.query.selected', 1
299
      # assert link properties
300
      assert_select 'a.query.selected[href=?]', '/projects/ecookbook/issues?query_id=5', :text => "Open issues by priority and tracker"
301
      # assert only one clear link exists
302
      assert_select 'a.icon-close-query', 1
303
      # assert clear link properties
304
      assert_select 'a.icon-close-query[title=?][href=?]', 'Clear', '/projects/ecookbook/issues?set_filter=1&sort=', 1
305
    end
295 306
  end
296 307

  
297 308
  def test_index_with_query_grouped_by_tracker
(7-7/7)