66 lines
2.7 KiB
Plaintext
66 lines
2.7 KiB
Plaintext
%p#notice= notice
|
|
|
|
- template = find_template(@section)
|
|
= render( template , section: @section)
|
|
|
|
.flex.flex-col.bg-white
|
|
.flex.items-center.justify-center.flex-1
|
|
.max-w-xl.px-4.py-8.mx-auto.text-center
|
|
%h1.text-3xl.font-bold.tracking-tight.text-gray-900
|
|
Page #{link_to @section.page.name, page_sections_url(@section.page.name), class: "underline"}
|
|
.flex.items-center.justify-center.flex-1
|
|
%h3.text-xl.font-bold.tracking-tight.text-gray-900
|
|
Section #{@section.index + 1}
|
|
|
|
.grid.grid-cols-3.gap-2.m-8
|
|
.relative.block.border.border-gray-100
|
|
%h3.mt-4.text-lg.font-bold Template #{@section.template}
|
|
= section_preview(@section , class: "w-full object-contain p-3")
|
|
= yellow_button( "Change Template" , section_select_template_url(@section.id))
|
|
|
|
.relative.block.border.border-gray-100
|
|
= section_form( class: "mx-auto mt-8 mb-0 max-w space-y-4") do
|
|
%label.block
|
|
%h4.text-lg.font-bold Header
|
|
= text_field_tag( :header , @section.header, class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")
|
|
%label.block
|
|
%h4.mt-4.text-lg.font-bold Text
|
|
= text_area_tag( :text , @section.text, rows: 5 ,class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm")
|
|
= submit_button("Update")
|
|
|
|
.relative.block.border.border-gray-100
|
|
%h3.mt-4.text-lg.font-bold Image
|
|
-if( @section.image.blank? )
|
|
%p No image
|
|
-else
|
|
= image_tag( "cms/" + @section.image , class: "p-3")
|
|
= yellow_button("Change Image", section_select_image_url(@section.id))
|
|
= red_button( "Remove image", section_set_image_path( @section.id , image: ""))
|
|
|
|
.grid.grid-cols-3.gap-2.m-8
|
|
- if( @section.cards? )
|
|
.relative.block.border.border-gray-100
|
|
%h3.mt-4.text-lg.font-bold Card Template #{@section.card_template}
|
|
=card_preview(@section , class: "w-full object-contain")
|
|
%p.p-3
|
|
=yellow_button("Change Card Template", section_select_card_template_url(@section.id))
|
|
|
|
.relative.block.border.border-gray-100
|
|
%h3.mt-4.text-lg.font-bold #{@section.cards.length} Cards
|
|
-@section.cards.each do |card|
|
|
.mt-4.text-md.font-bold= card.header
|
|
.text-sm #{card.text[0..70]} .....
|
|
%p.p-3
|
|
= yellow_button( "View and Edit Cards" , section_cards_url(@section.id))
|
|
= green_button( "New Card" , new_section_card_url(@section.id) )
|
|
|
|
.relative.block.border.border-gray-100
|
|
%h3.mt-4.text-lg.font-bold Options
|
|
= 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
|
|
-if @section.option_definitions.empty?
|
|
%p No options
|
|
-else
|
|
= submit_button("Update")
|