diff --git a/app/views/merged/cards/editors/_button.haml b/app/views/merged/cards/editors/_button.haml deleted file mode 100644 index bd91f0e..0000000 --- a/app/views/merged/cards/editors/_button.haml +++ /dev/null @@ -1,9 +0,0 @@ -.relative.block.border.border-gray-100 - %h3.mt-4.text-lg.font-bold= key.upcase - %p - .font-bold Text - = value["text"] -.relative.block.border.border-gray-100 - %p - .font-bold Link - = value["link"] diff --git a/app/views/merged/cards/editors/_header.haml b/app/views/merged/cards/editors/_header.haml deleted file mode 100644 index 6e5fee4..0000000 --- a/app/views/merged/cards/editors/_header.haml +++ /dev/null @@ -1,6 +0,0 @@ -.relative.block.border.border-gray-100 - %h3.mt-4.text-lg.font-bold Header - = form_tag( card_url(card.id) , {method: :patch } ) do - = text_field_tag( :header , card.content["header"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm") - %button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"} - Update diff --git a/app/views/merged/cards/editors/_id.haml b/app/views/merged/cards/editors/_id.haml deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/merged/cards/editors/_image.haml b/app/views/merged/cards/editors/_image.haml deleted file mode 100644 index 6a81d15..0000000 --- a/app/views/merged/cards/editors/_image.haml +++ /dev/null @@ -1,5 +0,0 @@ -.relative.block.border.border-gray-100 - -if( value.blank? ) - No image - -else - = image_tag( "cms/" + value) diff --git a/app/views/merged/cards/editors/_template.haml b/app/views/merged/cards/editors/_template.haml deleted file mode 100644 index 38cc40f..0000000 --- a/app/views/merged/cards/editors/_template.haml +++ /dev/null @@ -1,6 +0,0 @@ -.relative.block.border.border-gray-100 - %h3.mt-4.text-lg.font-bold= key.upcase + " : " + value - %button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-md.font-medium.text-white - =link_to "Change Template" , section_select_template_url(@section.id) -.relative.block.border.border-gray-100 - =image_tag("merged/section_preview/#{section.template}" , class: "w-full object-contain") diff --git a/app/views/merged/cards/editors/_text.haml b/app/views/merged/cards/editors/_text.haml deleted file mode 100644 index 139357b..0000000 --- a/app/views/merged/cards/editors/_text.haml +++ /dev/null @@ -1,6 +0,0 @@ -.relative.block.border.border-gray-100 - %h3.mt-4.text-lg.font-bold Text - = form_tag( card_url(card.id) , {method: :patch } ) do - = text_area_tag( :text , card.content["text"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm") - %button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"} - Update diff --git a/app/views/merged/cards/index.haml b/app/views/merged/cards/index.haml index e797aa9..dabd35f 100644 --- a/app/views/merged/cards/index.haml +++ b/app/views/merged/cards/index.haml @@ -18,8 +18,6 @@ =link_to( "Up" , "/index") %button.mt-4.rounded-lg.bg-yellow-500.p-4 =link_to "Down" , "/index" - %button.mt-4.rounded-lg.bg-blue-400.p-4 - =link_to "Edit" , card_path( @section.id) %button.mt-4.rounded-lg.bg-cyan-400.p-4 =link_to "New" , "/index" %button.mt-4.rounded-lg.bg-red-400.p-4 @@ -31,5 +29,21 @@ %button.ml-3.inline-block.rounded-lg.bg-red-500.px-5.py-3.text-md.font-medium.text-white = link_to( "Remove image" , card_set_image_path( card.id , image: "")) - - card.content.each do |key , value| - = render "merged/cards/editors/#{key}", card: card , key: key , value: value + .relative.block.border.border-gray-100 + %h3.mt-4.text-lg.font-bold Image + -if( card.image.blank? ) + %p No image + -else + = image_tag( "cms/" + card.image , class: "p-3") + .relative.block.border.border-gray-100 + = form_tag( card_url(card.id) , {method: :patch } ) do + %h3.mt-4.text-lg.font-bold Header + = text_field_tag( :header , card.content["header"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm") + %h3.mt-4.text-lg.font-bold Text + = text_area_tag( :text , card.content["text"], class: "w-full rounded-lg border-gray-200 p-4 pr-12 text-sm shadow-sm") + %button.ml-3.inline-block.rounded-lg.bg-blue-500.px-5.py-3.text-sm.font-medium.text-white{:type => "submit"} + Update + + .relative.block.border.border-gray-100 + %h3.mt-4.text-lg.font-bold Options + To be done diff --git a/app/views/merged/cards/view/_button.haml b/app/views/merged/cards/view/_button.haml deleted file mode 100644 index fe2d63a..0000000 --- a/app/views/merged/cards/view/_button.haml +++ /dev/null @@ -1,8 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - %p - .font-bold Text - = value["text"] - %p - .font-bold Link - = value["link"] diff --git a/app/views/merged/cards/view/_card b/app/views/merged/cards/view/_card deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/merged/cards/view/_card_template.haml b/app/views/merged/cards/view/_card_template.haml deleted file mode 100644 index 216b5ef..0000000 --- a/app/views/merged/cards/view/_card_template.haml +++ /dev/null @@ -1,5 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - %p= value - =image_tag("merged/card_preview/#{value}" , class: "w-full object-contain") - %p #{section.content['cards'].length} cards diff --git a/app/views/merged/cards/view/_cards.haml b/app/views/merged/cards/view/_cards.haml deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/merged/cards/view/_header.haml b/app/views/merged/cards/view/_header.haml deleted file mode 100644 index eaf2df3..0000000 --- a/app/views/merged/cards/view/_header.haml +++ /dev/null @@ -1,3 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - %p= value diff --git a/app/views/merged/cards/view/_id.haml b/app/views/merged/cards/view/_id.haml deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/merged/cards/view/_image.haml b/app/views/merged/cards/view/_image.haml deleted file mode 100644 index 2beb501..0000000 --- a/app/views/merged/cards/view/_image.haml +++ /dev/null @@ -1,6 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - -if value - = image_tag "cms/" + value - -else - No image diff --git a/app/views/merged/cards/view/_template.haml b/app/views/merged/cards/view/_template.haml deleted file mode 100644 index d8aafb3..0000000 --- a/app/views/merged/cards/view/_template.haml +++ /dev/null @@ -1,4 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - %p= value - =image_tag("merged/section_preview/#{section.template}" , class: "w-full object-contain") diff --git a/app/views/merged/cards/view/_text.haml b/app/views/merged/cards/view/_text.haml deleted file mode 100644 index eaf2df3..0000000 --- a/app/views/merged/cards/view/_text.haml +++ /dev/null @@ -1,3 +0,0 @@ -.p-6 - %h3.mt-4.text-lg.font-bold= key.upcase - %p= value diff --git a/app/views/merged/sections/index.html.haml b/app/views/merged/sections/index.html.haml index b120b3a..c448754 100644 --- a/app/views/merged/sections/index.html.haml +++ b/app/views/merged/sections/index.html.haml @@ -31,7 +31,8 @@ .relative.block.border.border-gray-100.p-4 - if section.cards? %h3.mt-4.text-lg.font-bold #{section.content['cards'].length} Cards - =card_preview(section , class: "w-full object-contain") + =link_to section_cards_url(section.id) do + =card_preview(section , class: "w-full object-contain") - else %h3.mt-4.text-lg.font-bold Image -if section.image diff --git a/app/views/merged/styles/index.haml b/app/views/merged/styles/index.haml index 5bb9fd4..8abd7e3 100644 --- a/app/views/merged/styles/index.haml +++ b/app/views/merged/styles/index.haml @@ -22,7 +22,7 @@ %h3.text-lg.font-medium.text-gray-900 Cards %p.mt-2.text-sm.leading-relaxed.text-gray-500.line-clamp-3 - -if(style.cards) + -if(style.cards?) Section may include cards. See card styles below -else Section may not include cards