56 lines
2.1 KiB
Plaintext
56 lines
2.1 KiB
Plaintext
- content_for( :merged_menu ) do
|
|
.text-xl.font-bold.text-gray-900
|
|
Page
|
|
= @page.name
|
|
.text-xl.text-gray-900
|
|
=link_to "View live" , "/#{@page.name}" , target: @page.name
|
|
|
|
= render "layouts/merged_header"
|
|
|
|
-@page.sections.each do |section |
|
|
.flex.gap-10.p-4{class: (section.index%2)==1 ? 'bg-cyan-50' : 'bg-red-50' , id: "section_#{section.id}"}
|
|
.basis-80
|
|
%h3.mt-4.text-lg.font-bold Section #{section.index} : #{section.header}
|
|
= blue_button( "Up" , section_move_url(section.id , dir: :up) )
|
|
= blue_button( "Down" , section_move_url(section.id , dir: :down) )
|
|
= yellow_button("Edit" , section_path(section.id) )
|
|
= green_button( "Copy" , new_page_section_url(@page.id, template: section.template) )
|
|
= form_tag( section_url(section.id) , {method: :delete } ) do
|
|
=submit_button( "Delete" , true)
|
|
.basis-72
|
|
%h3.mt-4.text-lg.font-bold Template
|
|
= link_to(section_select_template_url(section.id)) do
|
|
%p= section.template
|
|
= section_preview(section , class: "object-contain")
|
|
.basis-52.grow
|
|
%h3.mt-4.text-lg.font-bold Header
|
|
%p= section.header
|
|
%h3.mt-4.text-lg.font-bold Text
|
|
%p= section.text[0..100] + " ..." if section.text
|
|
.basis-72
|
|
- if section.has_cards?
|
|
%h3.mt-4.text-lg.font-bold #{section.cards.length} Cards
|
|
=link_to section_cards_url(section.id) do
|
|
=card_preview(section , class: "object-contain")
|
|
- else
|
|
= link_to(section_select_image_url(section.id)) do
|
|
%h3.mt-4.text-lg.font-bold Image
|
|
-if section.image
|
|
= image_tag( "cms/" + section.image , class: "h-40")
|
|
-else
|
|
%p No image
|
|
.basis-52.grow
|
|
%h3.mt-4.text-lg.font-bold Options
|
|
- section.options.each do|name , value|
|
|
%p
|
|
= name
|
|
= value
|
|
.grid.grid-cols-2.gap-2.m-8
|
|
.relative.block
|
|
%p
|
|
= green_button( "New Section" , new_page_section_url(@page.id) )
|
|
.relative.block
|
|
%p
|
|
= form_tag( page_url(@page.id) , {method: :delete } ) do
|
|
=submit_button( "Delete Page" , true)
|