Skip to content

[WIP] Enhance cover section by enabling user to change bg color #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@
@import "bootstrap-sprockets";
@import "bootstrap";

.bg-blue{background-color:blue;}
.widget.red {
background-color: #ff0000;
}
.widget.green {
background-color: #00ff00;
}
.widget.blue {
background-color: #0000ff;
}
2 changes: 1 addition & 1 deletion app/models/paragraph_widget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class ParagraphWidget < Widget
attribute :image, :reference
attribute :headline, :string
attribute :text, :string
attribute :color, :enum, values: %w[red green blue], default: 'blue'
attribute :background_color_select, :enum, values: ["red","green","blue"], default: "red"
end
3 changes: 2 additions & 1 deletion app/views/paragraph_widget/details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<%= scrivito_details_for ParagraphWidget.description_for_editor do %>
A cover with head, text and image
<% end %>
<% end %>
<%= scrivito_tag(:div, widget, :background_color_select) %>
<% end %>