Apply banner default colors to dev seeds

Banners created through the admin form were getting the default color.
However, banners 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 banners and
simplify the code at the same time thanks to its `attribute` method.

Now, when creating a new banner, instead of getting a blank space, we
get an empty line with the banner's default background color, which most
users won't know what it's about until they fill in the banner's title.
So we're not displaying the content of the banner when it's empty,
thanks to the `:empty` CSS pseudoclass.
This commit is contained in:
Javi Martín
2020-08-12 14:45:45 +02:00
parent 361b7ee09d
commit 0b83be6837
5 changed files with 16 additions and 20 deletions

View File

@@ -2292,6 +2292,10 @@ table {
a > * {
@include grid-row;
padding: 0 rem-calc(16);
&:empty {
display: none;
}
}
+ .budget.expanded,