Add default colours for legislation processes header
This commit is contained in:
@@ -42,6 +42,22 @@ 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.present? ? @process.background_color : default_bg_color
|
||||
end
|
||||
|
||||
def font_color_or_default
|
||||
@process.font_color.present? ? @process.font_color : default_font_color
|
||||
end
|
||||
|
||||
def css_for_process_header
|
||||
if banner_color?
|
||||
"background:" + @process.background_color + ";color:" + @process.font_color + ";"
|
||||
|
||||
@@ -218,12 +218,11 @@
|
||||
<p class="help-text"><%= t("admin.legislation.processes.form.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false, type: :color %>
|
||||
<%= f.text_field :background_color, label: false, type: :color,
|
||||
value: bg_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :background_color, label: false,
|
||||
placeholder: "#e7f2fc",
|
||||
id: "background_color_input" %>
|
||||
<%= f.text_field :background_color, label: false, id: "background_color_input" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,12 +232,10 @@
|
||||
<p class="help-text"><%= t("admin.legislation.processes.form.color_help") %></p>
|
||||
<div class="row collapse">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false, type: :color %>
|
||||
<%= f.text_field :font_color, label: false, type: :color, value: font_color_or_default %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= f.text_field :font_color, label: false,
|
||||
placeholder: "#222222",
|
||||
id: "font_color_input" %>
|
||||
<%= f.text_field :font_color, label: false, id: "font_color_input" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user