Project

General

Profile

Actions

Feature #18966

open

Make it easier to add OS-specific icons

Added by Alexander Olofsson about 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hard-coding the list of OS icons just means that the Foreman project becomes responsible for handling every single operating system beneath the sun, which isn't going to look nice on the operatingsystems_helper.rb file after a while.

Perhaps something as simple as;

--- a/app/helpers/operatingsystems_helper.rb
+++ b/app/helpers/operatingsystems_helper.rb
@@ -3,7 +3,8 @@ module OperatingsystemsHelper

   def icon(record, opts = {})
     return "" if record.blank? || record.name.blank?
-    family = case record.name
+    family = record.name if Rails.application.assets.find_asset record.name+'.png'
+    family ||= case record.name
              when /fedora/i
                "Fedora" 
              when /ubuntu/i

Though the asset pipeline might get in the way for people wanting to do lots of icon changes.

No data to display

Actions

Also available in: Atom PDF