Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

create a helper method for adding spot icons

bsatarnejadb36b1e93ebed
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index b80ba754ee1..9a8f8932c1d 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -36,6 +36,11 @@ module IconsHelper
%(<i class="#{classnames}" #{title} aria-hidden="true"></i>).html_safe
end
+ def spot_icon(classnames, title: nil)
+ title = "title=\"#{h(title)}\"" unless title.nil?
+ %(<span class="#{classnames}" #{title}></span>).html_safe
+ end
+
##
# Icon wrapper with an invisible label
def icon_wrapper(icon_class, label)