Skip to content

Commit

Permalink
Merge pull request #2311 from epwinchell/svg_quad
Browse files Browse the repository at this point in the history
Replace quad background PNGs with SVGs
  • Loading branch information
mzazrivec authored Oct 6, 2017
2 parents 7684a77 + 5ea35e5 commit 6a0ec02
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 17 deletions.
Binary file removed app/assets/images/layout/base-single.png
Binary file not shown.
25 changes: 25 additions & 0 deletions app/assets/images/layout/base-single.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/layout/base.png
Binary file not shown.
62 changes: 62 additions & 0 deletions app/assets/images/layout/base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/assets/stylesheets/patternfly_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ table.table.table-summary-screen tbody td img {
/// adjust power state images for use in quad icon
.b72 .stretch {
background-repeat: no-repeat;
width: 35px;
height: 32px;
margin: -3px 0 -2px 1px;
width: 36px;
height: 34px;
margin: -3px 0 -2px 0px;
border-top-right-radius: 15px;
}

Expand Down
24 changes: 12 additions & 12 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def img_tag_reflection
def render_physical_server_quadicon(item, options)
output = []
if settings(:quadicons, :physical_server)
output << flobj_img_simple("layout/base.png")
output << flobj_img_simple("layout/base.svg")

output << flobj_p_simple("a72", (item.host ? 1 : 0))
output << flobj_img_simple("svg/currentstate-#{h(item.power_state.try(:downcase))}.svg", "b72")
Expand Down Expand Up @@ -434,7 +434,7 @@ def quadicon_truncate_middle(value, trunc_to = 10)
end

def flobj_img_simple(image = nil, cls = '', size = 72)
image ||= "layout/base-single.png"
image ||= "layout/base-single.svg"

content_tag(:div, :class => "flobj #{cls}") do
encodable_image_tag(image, :size => size)
Expand Down Expand Up @@ -510,7 +510,7 @@ def render_host_quadicon(item, options)
output = []

if settings(:quadicons, :host)
output << flobj_img_simple("layout/base.png")
output << flobj_img_simple("layout/base.svg")

output << flobj_p_simple("a72", item.vms.size)
output << currentstate_icon(item.normalized_state.downcase)
Expand Down Expand Up @@ -556,7 +556,7 @@ def render_ext_management_system_quadicon(item, options)
output = []

if settings(:quadicons, db_for_quadicon)
output << flobj_img_simple("layout/base.png")
output << flobj_img_simple("layout/base.svg")
item_count = case item
when EmsPhysicalInfra then item.physical_servers.size
when EmsCloud then item.total_vms
Expand All @@ -572,7 +572,7 @@ def render_ext_management_system_quadicon(item, options)
output << flobj_img_simple(img_for_auth_status(item), "d72")
output << flobj_img_simple('100/shield.png', "g72") unless item.get_policies.empty?
else
output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")
output << flobj_img_small("svg/vendor-#{h(item.image_name)}.svg", "e72")
end

Expand All @@ -598,7 +598,7 @@ def render_ext_management_system_quadicon(item, options)
def render_ems_cluster_quadicon(item, options)
output = []

output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")
output << flobj_img_small("100/emscluster.png", "e72")
output << flobj_img_simple("100/shield.png", "g72") unless item.get_policies.empty?

Expand All @@ -620,7 +620,7 @@ def render_non_listicon_single_quadicon(item, options)

img_path = item.try(:decorate).try(:fileicon) || "100/#{item.class.base_class.to_s.underscore}.png"

output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")
output << flobj_img_simple(img_path, "e72")

unless options[:typ] == :listnav
Expand Down Expand Up @@ -662,7 +662,7 @@ def render_non_listicon_single_quadicon(item, options)
def render_listicon_single_quadicon(item, options)
output = []

output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")
output << flobj_img_small("100/#{@listicon}.png", "e72")

unless options[:typ] == :listnav
Expand Down Expand Up @@ -718,7 +718,7 @@ def render_storage_quadicon(item, options)
output = []

if settings(:quadicons, :storage)
output << flobj_img_simple("layout/base.png")
output << flobj_img_simple("layout/base.svg")
output << flobj_img_simple("100/storagetype-#{item.store_type.nil? ? "unknown" : h(item.store_type.to_s.downcase)}.png", "a72")
output << flobj_p_simple("b72", item.v_total_vms)
output << flobj_p_simple("c72", item.v_total_hosts)
Expand All @@ -727,7 +727,7 @@ def render_storage_quadicon(item, options)
output << flobj_img_simple("100/piecharts/datastore/#{h(space_percent)}.png", "d72")
else
space_percent = (item.used_space_percent_of_total.to_i + 9) / 10
output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")
output << flobj_img_simple("100/datastore-#{h(space_percent)}.png", "e72")
end

Expand Down Expand Up @@ -785,7 +785,7 @@ def render_vm_or_template_quadicon(item, options)
output = []

if settings(:quadicons, item.class.base_model.name.underscore.to_sym)
output << flobj_img_simple("layout/base.png")
output << flobj_img_simple("layout/base.svg")
output << flobj_img_simple("svg/os-#{h(item.os_image_name.downcase)}.svg", "a72")
output << currentstate_icon(item.normalized_state.downcase)
output << flobj_img_simple("svg/vendor-#{h(item.vendor.downcase)}.svg", "c72")
Expand All @@ -802,7 +802,7 @@ def render_vm_or_template_quadicon(item, options)
output << flobj_p_simple("d72", h(item.v_total_snapshots))
end
else
output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple("layout/base-single.svg")

if quadicon_policy_sim? && !session[:policies].empty?
output << flobj_img_small(img_for_compliance(item), "e72")
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/listnav/_compare_sections.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- if %w(MiqTemplate VmOrTemplate Vm).include?(@sb[:compare_db])
- if settings(:quadicons, :vm)
.flobj
%img{:src => image_path("layout/base.png")}
%img{:src => image_path("layout/base.svg")}
%div{:class => "flobj b72"}
- if @drift_obj.template?
- if @drift_obj.host
Expand Down Expand Up @@ -44,7 +44,7 @@
- elsif @sb[:compare_db] == "Host"
- if settings(:quadicons, :host)
.flobj
%img{:src => image_path("layout/base.png")}
%img{:src => image_path("layout/base.svg")}
%div{:class => "flobj c72"}
%img{:src => image_path("svg/vendor-#{h(@drift_obj.vmm_vendor_display.downcase)}.svg")}
- unless @drift_obj.power_state.blank?
Expand Down

0 comments on commit 6a0ec02

Please sign in to comment.