implement options, buttons and fixed bg

This commit is contained in:
2022-12-04 16:47:52 +02:00
parent 236d10a768
commit 77a7917869
12 changed files with 118 additions and 9 deletions

View File

@ -0,0 +1,4 @@
%label.block
%h4.text-lg.font-bold
= option.name.capitalize
= select_tag( "option[#{option.name}]" , options_for_select(option.values, section.option(option.name)), class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")

View File

@ -0,0 +1,4 @@
%label.block
%h4.text-lg.font-bold
= option.name
= text_field_tag( "option[#{option.name}]" , section.option(option.name), class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")

View File

@ -37,6 +37,9 @@
%p No image
.relative.block.border.border-gray-100.p-4
%h3.mt-4.text-lg.font-bold Options
%p To be done
- section.options.each do|name , value|
%p
= name
= value
%p
= green_button( "New Section" , new_page_section_url(@page.name) )

View File

@ -56,4 +56,7 @@
.relative.block.border.border-gray-100
%h3.mt-4.text-lg.font-bold Options
To be done
= section_form( class: "mx-auto mt-8 mb-0 max-w space-y-4") do
- @section.option_definitions.each do |option|
=render "option_form_#{option.type}" , section: @section , option: option
= submit_button("Update")

View File

@ -1,4 +1,4 @@
%section.overflow-hidden.bg-cover.bg-center.bg-no-repeat{style: bg(section)}
%section.overflow-hidden.bg-cover.bg-center.bg-no-repeat{bg(section)}
.mx-auto.max-w-screen-2xl.px-4.py-8.sm:px-6.lg:px-8
.grid.grid-cols-1.gap-4.md:grid-cols-2
.p-8.md:p-12.lg:px-16.lg:py-24{class: 'bg-black/25'}

View File

@ -1 +1,2 @@
= blue_button( section.button_text , section.button_link)
- unless section.button_text.blank? or section.button_link.blank?
= blue_button( section.button_text , section.button_link)