mirror of
https://github.com/meineerde/redmine.git
synced 2025-10-17 17:01:01 +00:00
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:
parent
1545119ff0
commit
7645774634
@ -351,6 +351,10 @@
|
|||||||
<path d="M7 5.03v5.455"/>
|
<path d="M7 5.03v5.455"/>
|
||||||
<path d="M12 8l5 -3"/>
|
<path d="M12 8l5 -3"/>
|
||||||
</symbol>
|
</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">
|
<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="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"/>
|
<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 |
@ -1891,10 +1891,15 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
|
|||||||
flex-shrink: 0;
|
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;
|
stroke: #c61a1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.icon:hover .icon-svg-filled, a.icon-only:hover .icon-svg-filled {
|
||||||
|
stroke: none;
|
||||||
|
fill: #c61a1a;
|
||||||
|
}
|
||||||
|
|
||||||
svg.icon-ok {
|
svg.icon-ok {
|
||||||
stroke: #5db651;
|
stroke: #5db651;
|
||||||
}
|
}
|
||||||
@ -1918,6 +1923,11 @@ svg.icon-svg {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svg.icon-svg-filled {
|
||||||
|
fill: #169;
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
|
||||||
svg.s20 {
|
svg.s20 {
|
||||||
width: 1.25rem;
|
width: 1.25rem;
|
||||||
height: 1.25rem;
|
height: 1.25rem;
|
||||||
|
|||||||
@ -21,10 +21,10 @@ module IconsHelper
|
|||||||
DEFAULT_ICON_SIZE = "18"
|
DEFAULT_ICON_SIZE = "18"
|
||||||
DEFAULT_SPRITE = "icons"
|
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"
|
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
|
if label
|
||||||
label_classes = ["icon-label"]
|
label_classes = ["icon-label"]
|
||||||
@ -92,8 +92,9 @@ module IconsHelper
|
|||||||
|
|
||||||
private
|
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 = "s#{size} icon-svg"
|
||||||
|
css_classes += " icon-svg-filled" if style == :filled
|
||||||
css_classes += " #{css_class}" unless css_class.nil?
|
css_classes += " #{css_class}" unless css_class.nil?
|
||||||
css_classes += " icon-rtl" if rtl
|
css_classes += " icon-rtl" if rtl
|
||||||
|
|
||||||
|
|||||||
@ -233,3 +233,6 @@
|
|||||||
svg: bulb
|
svg: bulb
|
||||||
- name: message-report
|
- name: message-report
|
||||||
svg: message-report
|
svg: message-report
|
||||||
|
- name: quote-filled
|
||||||
|
svg: quote
|
||||||
|
style: filled
|
||||||
@ -27,11 +27,11 @@ module Redmine
|
|||||||
def quote_reply(url, selector_for_content, icon_only: false)
|
def quote_reply(url, selector_for_content, icon_only: false)
|
||||||
quote_reply_function = "quoteReply('#{j url}', '#{j selector_for_content}', '#{j Setting.text_formatting}')"
|
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
|
html_options[:title] = l(:button_quote) if icon_only
|
||||||
|
|
||||||
link_to_function(
|
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,
|
quote_reply_function,
|
||||||
html_options
|
html_options
|
||||||
)
|
)
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
unless Rails.env.production?
|
unless Rails.env.production?
|
||||||
ICON_RELEASE_VERSION = "v3.19.0"
|
ICON_RELEASE_VERSION = "v3.33.0"
|
||||||
ICON_DEFAULT_STYLE = "outline"
|
ICON_DEFAULT_STYLE = "outline"
|
||||||
SOURCE = URI.parse("https://raw.githubusercontent.com/tabler/tabler-icons/#{ICON_RELEASE_VERSION}/icons")
|
SOURCE = URI.parse("https://raw.githubusercontent.com/tabler/tabler-icons/#{ICON_RELEASE_VERSION}/icons")
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,13 @@ class IconsHelperTest < Redmine::HelperTest
|
|||||||
assert_match expected, icon
|
assert_match expected, icon
|
||||||
end
|
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
|
def test_file_icon_should_return_folder_icon_for_directory
|
||||||
entry = stub(:is_dir? => true)
|
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>}
|
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>}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class JournalsHelperTest < Redmine::HelperTest
|
|||||||
journals = issue.visible_journals_with_index # add indice
|
journals = issue.visible_journals_with_index # add indice
|
||||||
journal_actions = render_journal_actions(issue, journals.first, {reply_links: true})
|
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, '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-del"]'
|
||||||
assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-copy-link"]'
|
assert_select_in journal_actions, 'div[class="drdn-items"] a[class="icon icon-copy-link"]'
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class QuoteReplyHelperTest < ActionView::TestCase
|
|||||||
|
|
||||||
a_tag = quote_reply(url, '#issue_description_wiki')
|
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, %|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='
|
assert_not_includes a_tag, 'title='
|
||||||
|
|
||||||
# When icon_only is true
|
# When icon_only is true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user