Apply Legislation Process default colors to dev seeds
Legislation Processes created through the admin form were getting the default color. However, Legislation processes created by other means (like the `db:dev_seed` rake task) were not getting these default values. This feature was originally implemented when we were using Rails 4. With Rails 5, we can provide default values to all new Legislation processes and simplify the code at the same time thanks to its `attribute` method. Related commit: https://github.com/consul/consul/pull/4080/commits/0b83be6
This commit is contained in:
@@ -22,22 +22,6 @@ module LegislationHelper
|
||||
@process.background_color.present? && @process.font_color.present?
|
||||
end
|
||||
|
||||
def default_bg_color
|
||||
"#e7f2fc"
|
||||
end
|
||||
|
||||
def default_font_color
|
||||
"#222222"
|
||||
end
|
||||
|
||||
def bg_color_or_default
|
||||
@process.background_color.presence || default_bg_color
|
||||
end
|
||||
|
||||
def font_color_or_default
|
||||
@process.font_color.presence || default_font_color
|
||||
end
|
||||
|
||||
def css_for_process_header
|
||||
if banner_color?
|
||||
"background: #{@process.background_color};color: #{@process.font_color};"
|
||||
|
||||
Reference in New Issue
Block a user