From 09938ac490b22507516882f3723cbc13d906b26b Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 8 Sep 2024 17:25:49 +0000 Subject: [PATCH] Replaces icon-sorted-asc and icon-sorted-desc with SVG icons (#23980). git-svn-id: https://svn.redmine.org/redmine/trunk@23042 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/assets/stylesheets/application.css | 4 ++-- app/helpers/queries_helper.rb | 4 +++- app/helpers/sort_helper.rb | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c3ce852c2..1df43a74b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1776,8 +1776,8 @@ span.icon-label { .icon-bookmark:not(:has(svg)) { background-image: url(/tag_blue_delete.png); } .icon-bookmark-off:not(:has(svg)) { background-image: url(/tag_blue_add.png); } .icon-bookmarked-project:not(:has(svg)) { background-image: url(/tag_blue.png); } -.icon-sorted-asc { background-image: url(/arrow_down.png); } -.icon-sorted-desc { background-image: url(/arrow_up.png); } +.icon-sorted-asc:not(:has(svg)) { background-image: url(/arrow_down.png); } +.icon-sorted-desc:not(:has(svg)) { background-image: url(/arrow_up.png); } .icon-toggle-plus { background-image: url(/bullet_toggle_plus.png) } .icon-toggle-minus { background-image: url(/bullet_toggle_minus.png) } .icon-clear-query:not(:has(svg)) { background-image: url(/close_hl.png); } diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 26d1ee48b..2712b6151 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -205,9 +205,11 @@ module QueriesHelper if column.name.to_s == query.sort_criteria.first_key if query.sort_criteria.first_asc? css = 'sort asc icon icon-sorted-desc' + icon = 'angle-up' order = 'desc' else css = 'sort desc icon icon-sorted-asc' + icon = 'angle-down' order = 'asc' end end @@ -223,7 +225,7 @@ module QueriesHelper end content = link_to( - column.caption, + icon_with_label(icon, column.caption), {:params => request.query_parameters.deep_merge(sort_param)}, link_options ) diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index 603f0f9f2..b827c61c4 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -116,16 +116,18 @@ module SortHelper if column.to_s == @sort_criteria.first_key if @sort_criteria.first_asc? css = 'sort asc icon icon-sorted-desc' + icon = 'angle-up' order = 'desc' else css = 'sort desc icon icon-sorted-asc' + icon = 'angle-down' order = 'asc' end end caption = column.to_s.humanize unless caption sort_options = {:sort => @sort_criteria.add(column.to_s, order).to_param} - link_to(caption, {:params => request.query_parameters.merge(sort_options)}, :class => css) + link_to(icon_with_label(icon, caption), {:params => request.query_parameters.merge(sort_options)}, :class => css) end # Returns a table header tag with a sort link for the named column -- 2.39.5