improve section and preview rendering

This commit is contained in:
2023-01-10 21:13:09 +02:00
parent c9afd4f3bc
commit a8f5229935
6 changed files with 9 additions and 12 deletions

View File

@ -5,8 +5,7 @@
= link_to @section.header , merged.section_path( @section.id) , class: "underline"
= link_to( "New Card" , merged.new_section_card_path(@section.id) , class: "p-2 border border-gray-200 bg-cyan-100 font-bold rounded-lg hover:bg-sky-100")
- template = find_template(@section)
= render( template , section: @section)
= render_section( @section )
- @section.cards.each_with_index do |card , index|
.flex.gap-10.px-20.pt-4.pb-2.mb-2.border.border-2.bg-neutral-50.border-slate-400{ id: "card_#{card.id}"}

View File

@ -2,8 +2,7 @@
= render "sections_pagination" , section: @section
= link_to( "New Section" , merged.new_page_section_path(@section.page.id) , class: button_classes + " bg-cyan-100")
- template = find_template(@section)
= render( template , section: @section)
= render_section( @section )
.flex.gap-8.my-10.flex-wrap.mx-20
.basis-80

View File

@ -7,8 +7,7 @@
= distance_of_time_in_words_to_now last_blog.updated_at
ago
%hr.mt-2.border.border-4.border-gray-600
- template = find_template(last_blog)
= render( template , section: last_blog)
= render_section( last_blog )
.flex.justify-between.items-center.border-b-8.border-gray-600
.ml-20.mb-2.text-lg
= section.text

View File

@ -1,3 +1,2 @@
- @page.sections.each do |section|
- template = find_template(section)
= render( template , section: section)
= render_section( section )