fix color css rendering on non existing color

For instances already/still having entries (priorities, status, ...) with color_id = 0, we need to check explicitly if the color exists
pull/6702/head
Jens Ulferts 6 years ago committed by Oliver Günther
parent fe21fd7992
commit e9cf11351a
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      app/views/highlighting/styles.css.erb

@ -1,12 +1,13 @@
<%
colored_resource = Proc.new do |name, scope|
scope.includes(:color).find_each do |entry|
if entry.color_id.nil?
color = entry.color
if color.nil?
concat ".__hl_dot_#{name}_#{entry.id}::before { display: none }\n"
next
end
color = entry.color
styles = color.color_styles
inline_style = styles.map{|k,v| "#{k}:#{v} !important"}.join(';')

Loading…
Cancel
Save