mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
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
This commit is contained in:
@@ -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(';')
|
||||
|
||||
Reference in New Issue
Block a user