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)
sprite = plugin ? "plugin_assets/#{plugin}/#{sprite}.svg" : "#{sprite}.svg"
end
end
- #
def file_icon(entry, name, size: DEFAULT_ICON_SIZE, css_class: nil)
if entry.is_dir?
sprite_icon("folder", name, size: size, css_class: css_class)
def activity_event_type_icon(event_type, size: DEFAULT_ICON_SIZE, css_class: nil)
icon_name = case event_type
- when 'reply'
- 'comments'
- when 'time-entry'
- 'time'
- when 'message'
- 'comment'
- else
- event_type
- end
+ when 'reply'
+ 'comments'
+ when 'time-entry'
+ 'time'
+ when 'message'
+ 'comment'
+ else
+ event_type
+ end
sprite_icon(icon_name, size: size, css_class: css_class)
end