From 9f86fabb018214ebd2709534fd446deec7b80874 Mon Sep 17 00:00:00 2001 From: ishikawa999 Date: Mon, 3 Mar 2025 06:45:13 +0000 Subject: [PATCH] Change the quote icon to filled quote icon --- app/assets/images/icons.svg | 4 ++++ app/assets/stylesheets/application.css | 4 ++++ app/helpers/icons_helper.rb | 7 ++++--- config/icon_source.yml | 3 +++ lib/redmine/quote_reply.rb | 4 ++-- lib/tasks/icons.rake | 2 +- test/helpers/icons_helper_test.rb | 7 +++++++ test/helpers/journals_helper_test.rb | 2 +- test/unit/lib/redmine/quote_reply_helper_test.rb | 2 +- 9 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg index 55925cddd..8174f0b9a 100644 --- a/app/assets/images/icons.svg +++ b/app/assets/images/icons.svg @@ -322,6 +322,10 @@ + + + + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a17be1e81..aa0616af4 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1789,6 +1789,10 @@ svg.icon-svg { vertical-align: middle; } +svg.icon-svg.filled { + fill: #169; +} + svg.s20 { width: 1.25rem; height: 1.25rem; diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 99006308e..809f0e297 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -21,10 +21,10 @@ module IconsHelper DEFAULT_ICON_SIZE = "18" DEFAULT_SPRITE = "icons" - def sprite_icon(icon_name, label = nil, icon_only: false, size: DEFAULT_ICON_SIZE, css_class: nil, sprite: DEFAULT_SPRITE, plugin: nil) + def sprite_icon(icon_name, label = nil, icon_only: false, size: DEFAULT_ICON_SIZE, css_class: nil, sprite: DEFAULT_SPRITE, icon_style: :outline, plugin: nil) sprite = plugin ? "plugin_assets/#{plugin}/#{sprite}.svg" : "#{sprite}.svg" - svg_icon = svg_sprite_icon(icon_name, size: size, css_class: css_class, sprite: sprite) + svg_icon = svg_sprite_icon(icon_name, size: size, css_class: css_class, sprite: sprite, icon_style: icon_style) if label label_classes = ["icon-label"] @@ -69,8 +69,9 @@ module IconsHelper private - def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil) + def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil, icon_style: :outline) css_classes = "s#{size} icon-svg" + css_classes += " filled" if icon_style == :filled css_classes += " #{css_class}" unless css_class.nil? content_tag( diff --git a/config/icon_source.yml b/config/icon_source.yml index 8769a3212..eab85f611 100644 --- a/config/icon_source.yml +++ b/config/icon_source.yml @@ -209,3 +209,6 @@ svg: square-rounded-plus - name: toggle-minus svg: square-rounded-minus +- name: quote + svg: quote + style: filled \ No newline at end of file diff --git a/lib/redmine/quote_reply.rb b/lib/redmine/quote_reply.rb index 05737c079..04bd94932 100644 --- a/lib/redmine/quote_reply.rb +++ b/lib/redmine/quote_reply.rb @@ -27,11 +27,11 @@ module Redmine def quote_reply(url, selector_for_content, icon_only: false) quote_reply_function = "quoteReply('#{j url}', '#{j selector_for_content}', '#{j Setting.text_formatting}')" - html_options = { class: 'icon icon-comment' } + html_options = { class: 'icon icon-quote' } html_options[:title] = l(:button_quote) if icon_only link_to_function( - sprite_icon('comment', l(:button_quote), icon_only: icon_only), + sprite_icon('quote', l(:button_quote), icon_only: icon_only, icon_style: :filled), quote_reply_function, html_options ) diff --git a/lib/tasks/icons.rake b/lib/tasks/icons.rake index e50c450a1..3410b05ba 100644 --- a/lib/tasks/icons.rake +++ b/lib/tasks/icons.rake @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. unless Rails.env.production? - ICON_RELEASE_VERSION = "v3.19.0" + ICON_RELEASE_VERSION = "v3.30.0" ICON_DEFAULT_STYLE = "outline" SOURCE = URI.parse("https://raw.githubusercontent.com/tabler/tabler-icons/#{ICON_RELEASE_VERSION}/icons") diff --git a/test/helpers/icons_helper_test.rb b/test/helpers/icons_helper_test.rb index ab0b58db4..936f9e8e3 100644 --- a/test/helpers/icons_helper_test.rb +++ b/test/helpers/icons_helper_test.rb @@ -71,6 +71,13 @@ class IconsHelperTest < Redmine::HelperTest assert_match expected, icon end + def test_sprite_icon_should_return_svg_with_filled_class_when_icon_style_is_filled + expected = %r{$} + icon = sprite_icon('edit', icon_style: :filled) + + assert_match expected, icon + end + def test_file_icon_should_return_folder_icon_for_directory entry = stub(:is_dir? => true) expected = %r{folder_name} diff --git a/test/helpers/journals_helper_test.rb b/test/helpers/journals_helper_test.rb index 355d5ec6f..a5a553d60 100644 --- a/test/helpers/journals_helper_test.rb +++ b/test/helpers/journals_helper_test.rb @@ -47,7 +47,7 @@ class JournalsHelperTest < Redmine::HelperTest journals = issue.visible_journals_with_index # add indice journal_actions = render_journal_actions(issue, journals.first, {reply_links: true}) - assert_select_in journal_actions, 'a[title=?][class="icon icon-comment"]', 'Quote' + assert_select_in journal_actions, 'a[title=?][class="icon icon-quote"]', 'Quote' assert_select_in journal_actions, 'a[title=?][class="icon-only icon-edit"]', 'Edit' assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-del"]' assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-copy-link"]' diff --git a/test/unit/lib/redmine/quote_reply_helper_test.rb b/test/unit/lib/redmine/quote_reply_helper_test.rb index 43adb521b..cbac1f6d0 100644 --- a/test/unit/lib/redmine/quote_reply_helper_test.rb +++ b/test/unit/lib/redmine/quote_reply_helper_test.rb @@ -29,7 +29,7 @@ class QuoteReplyHelperTest < ActionView::TestCase a_tag = quote_reply(url, '#issue_description_wiki') assert_includes a_tag, %|onclick="#{h "quoteReply('/issues/1/quoted', '#issue_description_wiki', 'common_mark'); return false;"}"| - assert_includes a_tag, %|class="icon icon-comment"| + assert_includes a_tag, %|class="icon icon-quote"| assert_not_includes a_tag, 'title=' # When icon_only is true -- 2.47.1