Project

General

Profile

Feature #43087 » 43087.patch

Go MAEDA, 2025-08-02 09:59

View differences:

app/helpers/icons_helper.rb
21 21
  DEFAULT_ICON_SIZE = "18"
22 22
  DEFAULT_SPRITE = "icons"
23 23

  
24
  include Redmine::Themes::Helper
25

  
26
  def sprite_source(sprite: DEFAULT_SPRITE, plugin: nil)
27
    if plugin
28
      "plugin_assets/#{plugin}/#{sprite}.svg"
29
    elsif current_theme && current_theme.images.include?("#{sprite}.svg")
30
      current_theme.image_path("#{sprite}.svg")
31
    else
32
      "#{sprite}.svg"
33
    end
34
  end
35

  
24 36
  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)
25
    sprite = plugin ? "plugin_assets/#{plugin}/#{sprite}.svg" : "#{sprite}.svg"
37
    sprite = sprite_source(sprite: sprite, plugin: plugin)
26 38

  
27 39
    svg_icon = svg_sprite_icon(icon_name, size: size, style: style, css_class: css_class, sprite: sprite, rtl: rtl)
28 40

  
(2-2/2)