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
This commit is contained in:
Marius Balteanu
2025-05-30 20:04:46 +00:00
parent 1545119ff0
commit 7645774634
9 changed files with 34 additions and 9 deletions

View File

@@ -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"/>

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -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;

View File

@@ -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

View File

@@ -233,3 +233,6 @@
svg: bulb
- name: message-report
svg: message-report
- name: quote-filled
svg: quote
style: filled

View File

@@ -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
)

View File

@@ -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")

View File

@@ -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>}

View File

@@ -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"]'

View File

@@ -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