From f81922fe01cd023f9a130016c9a685f0849c6559 Mon Sep 17 00:00:00 2001 From: Torsten Date: Fri, 2 Dec 2022 11:18:55 +0200 Subject: [PATCH] add section previews during editing --- app/views/merged/cards/index.haml | 5 ++++- app/views/merged/sections/show.html.haml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/merged/cards/index.haml b/app/views/merged/cards/index.haml index dec5dca..8387e9d 100644 --- a/app/views/merged/cards/index.haml +++ b/app/views/merged/cards/index.haml @@ -1,5 +1,8 @@ %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 @@ -8,7 +11,7 @@ .flex.items-center.justify-center.flex-1 %h3.text-xl.font-bold.tracking-tight.text-gray-900 Cards for - = link_to "Section #{@section.index + 1}", page_sections_url(page_id: @section.page.name) + = link_to "Section #{@section.index + 1}", section_url( @section.id) .grid.grid-cols-4.gap-2.m-8 - @section.cards.each_with_index do |card , index| diff --git a/app/views/merged/sections/show.html.haml b/app/views/merged/sections/show.html.haml index e85d20f..4ccac7c 100644 --- a/app/views/merged/sections/show.html.haml +++ b/app/views/merged/sections/show.html.haml @@ -1,5 +1,8 @@ %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