summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2025-05-30 20:04:46 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2025-05-30 20:04:46 +0000
commit7645774634b89f69cb013857c52baf01c1728b70 (patch)
treea6dfef18af6710523138ac55f609e309341571c3
parent1545119ff08aaab877be791e427d46655ff32633 (diff)
downloadredmine-7645774634b89f69cb013857c52baf01c1728b70.tar.gz
redmine-7645774634b89f69cb013857c52baf01c1728b70.zip
Change quote note icon to quotation marks (#31531).
Patch by Mizuki ISHIKAWA (user:ishikawa999) and Marius BALTEANU (user:marius.balteanu). git-svn-id: https://svn.redmine.org/redmine/trunk@23809 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/assets/images/icons.svg4
-rw-r--r--app/assets/stylesheets/application.css12
-rw-r--r--app/helpers/icons_helper.rb7
-rw-r--r--config/icon_source.yml3
-rw-r--r--lib/redmine/quote_reply.rb4
-rw-r--r--lib/tasks/icons.rake2
-rw-r--r--test/helpers/icons_helper_test.rb7
-rw-r--r--test/helpers/journals_helper_test.rb2
-rw-r--r--test/unit/lib/redmine/quote_reply_helper_test.rb2
9 files changed, 34 insertions, 9 deletions
diff --git a/app/assets/images/icons.svg b/app/assets/images/icons.svg
index df635523a..e30ef5446 100644
--- a/app/assets/images/icons.svg
+++ b/app/assets/images/icons.svg
@@ -351,6 +351,10 @@
<path d="M7 5.03v5.455"/>
<path d="M12 8l5 -3"/>
</symbol>
+ <symbol viewBox="0 0 24 24" id="icon--quote-filled">
+ <path d="M9 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z"/>
+ <path d="M18 5a2 2 0 0 1 2 2v6c0 3.13 -1.65 5.193 -4.757 5.97a1 1 0 1 1 -.486 -1.94c2.227 -.557 3.243 -1.827 3.243 -4.03v-1h-3a2 2 0 0 1 -1.995 -1.85l-.005 -.15v-3a2 2 0 0 1 2 -2z"/>
+ </symbol>
<symbol viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round" id="icon--reload">
<path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"/>
<path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index e6ca6f736..5a1546899 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -1891,10 +1891,15 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
flex-shrink: 0;
}
-a.icon:hover svg, a.icon-only:hover svg {
+a.icon:hover .icon-svg, a.icon-only:hover .icon-svg {
stroke: #c61a1a;
}
+a.icon:hover .icon-svg-filled, a.icon-only:hover .icon-svg-filled {
+ stroke: none;
+ fill: #c61a1a;
+}
+
svg.icon-ok {
stroke: #5db651;
}
@@ -1918,6 +1923,11 @@ svg.icon-svg {
vertical-align: middle;
}
+svg.icon-svg-filled {
+ fill: #169;
+ stroke: none;
+}
+
svg.s20 {
width: 1.25rem;
height: 1.25rem;
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index f96315c75..6afb84537 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, rtl: false)
+ def sprite_icon(icon_name, label = nil, icon_only: false, size: DEFAULT_ICON_SIZE, style: :outline, css_class: nil, sprite: DEFAULT_SPRITE, plugin: nil, rtl: false)
sprite = plugin ? "plugin_assets/#{plugin}/#{sprite}.svg" : "#{sprite}.svg"
- svg_icon = svg_sprite_icon(icon_name, size: size, css_class: css_class, sprite: sprite, rtl: rtl)
+ svg_icon = svg_sprite_icon(icon_name, size: size, style: style, css_class: css_class, sprite: sprite, rtl: rtl)
if label
label_classes = ["icon-label"]
@@ -92,8 +92,9 @@ module IconsHelper
private
- def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, sprite: DEFAULT_SPRITE, css_class: nil, rtl: false)
+ def svg_sprite_icon(icon_name, size: DEFAULT_ICON_SIZE, style: :outline, sprite: DEFAULT_SPRITE, css_class: nil, rtl: false)
css_classes = "s#{size} icon-svg"
+ css_classes += " icon-svg-filled" if style == :filled
css_classes += " #{css_class}" unless css_class.nil?
css_classes += " icon-rtl" if rtl
diff --git a/config/icon_source.yml b/config/icon_source.yml
index 38ad2fbf4..64f0a1d8c 100644
--- a/config/icon_source.yml
+++ b/config/icon_source.yml
@@ -233,3 +233,6 @@
svg: bulb
- name: message-report
svg: message-report
+- name: quote-filled
+ 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..2bf41d405 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-filled', l(:button_quote), icon_only: icon_only, style: :filled),
quote_reply_function,
html_options
)
diff --git a/lib/tasks/icons.rake b/lib/tasks/icons.rake
index e50c450a1..269ef43e2 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.33.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..7ef071f86 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_style_is_filled
+ expected = %r{<svg class="s18 icon-svg icon-svg-filled" aria-hidden="true"><use href="/assets/icons-\w+.svg#icon--edit"></use></svg>$}
+ icon = sprite_icon('edit', style: :filled)
+
+ assert_match expected, icon
+ end
+
def test_file_icon_should_return_folder_icon_for_directory
entry = stub(:is_dir? => true)
expected = %r{<svg class="s18 icon-svg" aria-hidden="true"><use href="/assets/icons-\w+.svg#icon--folder"></use></svg><span class="icon-label">folder_name</span>}
diff --git a/test/helpers/journals_helper_test.rb b/test/helpers/journals_helper_test.rb
index b8ecec685..47f7b7749 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