From e7c6ea90f71afcd17fba2a734da5bf7d36c12f81 Mon Sep 17 00:00:00 2001 From: Torsten Date: Thu, 19 Jan 2023 22:32:56 +0200 Subject: [PATCH] some preose work, card up/down --- app/assets/stylesheets/merged.tailwind.css | 1 + app/assets/stylesheets/merged/merged.css | 17 +++++++++++++++++ app/models/merged/section.rb | 2 +- app/views/merged/cards/index.haml | 11 +++++++++-- app/views/merged/view/_section_small_image.haml | 17 ++++++++--------- .../merged/view/cards/_card_wide_square.haml | 2 +- config/merged/section_styles.yml | 1 + lib/merged/shared_helper.rb | 2 +- 8 files changed, 39 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/merged.tailwind.css b/app/assets/stylesheets/merged.tailwind.css index aed2e91..12920b2 100644 --- a/app/assets/stylesheets/merged.tailwind.css +++ b/app/assets/stylesheets/merged.tailwind.css @@ -4,4 +4,5 @@ .prose{ color: inherit; + --tw-prose-bullets: #6b7280; } diff --git a/app/assets/stylesheets/merged/merged.css b/app/assets/stylesheets/merged/merged.css index 31d1055..16232b3 100644 --- a/app/assets/stylesheets/merged/merged.css +++ b/app/assets/stylesheets/merged/merged.css @@ -1570,6 +1570,10 @@ select { margin-top: 5rem; } +.mt-0 { + margin-top: 0px; +} + .block { display: block; } @@ -2639,6 +2643,7 @@ select { .prose{ color: inherit; + --tw-prose-bullets: #6b7280; } .hover\:scale-105:hover { @@ -2855,6 +2860,14 @@ select { margin-right: 3rem; } + .md\:mt-0 { + margin-top: 0px; + } + + .md\:mt-6 { + margin-top: 1.5rem; + } + .md\:grid { display: grid; } @@ -2943,6 +2956,10 @@ select { margin-bottom: 0px; } + .lg\:mt-0 { + margin-top: 0px; + } + .lg\:h-96 { height: 24rem; } diff --git a/app/models/merged/section.rb b/app/models/merged/section.rb index b6dd922..81c7014 100644 --- a/app/models/merged/section.rb +++ b/app/models/merged/section.rb @@ -34,7 +34,7 @@ module Merged end def has_cards? - ! card_template.blank? + template_style.has_cards? end def move_up diff --git a/app/views/merged/cards/index.haml b/app/views/merged/cards/index.haml index 9db1606..271fb18 100644 --- a/app/views/merged/cards/index.haml +++ b/app/views/merged/cards/index.haml @@ -12,8 +12,15 @@ .basis-60 %h3.mt-4.text-lg.font-bold Card #{index + 1}:#{card.header} .flex.flex-wrap - = blue_button( "Up" , merged.card_move_path(card.id , dir: :up) ) - = blue_button( "Down" , merged.card_move_path(card.id , dir: :down) ) + .p-2 + =link_to(merged.card_move_path(card.id , dir: :down)) do + %svg.w-6.h-6{:fill => "none", :stroke => "currentColor", "stroke-width" => "1.5", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"} + %path{:d => "M8.25 6.75L12 3m0 0l3.75 3.75M12 3v18", "stroke-linecap" => "round", "stroke-linejoin" => "round"} + .p-2 + =link_to(merged.card_move_path(card.id , dir: :up)) do + %svg.w-6.h-6{:fill => "none", :stroke => "currentColor", "stroke-width" => "1.5", :viewbox => "0 0 24 24", :xmlns => "http://www.w3.org/2000/svg"} + %path{:d => "M15.75 17.25L12 21m0 0l-3.75-3.75M12 21V3", "stroke-linecap" => "round", "stroke-linejoin" => "round"} + .mt-6 .basis-full.mt-3 Updated at: diff --git a/app/views/merged/view/_section_small_image.haml b/app/views/merged/view/_section_small_image.haml index 67b92f7..978c2b3 100644 --- a/app/views/merged/view/_section_small_image.haml +++ b/app/views/merged/view/_section_small_image.haml @@ -1,12 +1,11 @@ .flex.justify-center.p-8.flex-col.lg:flex-row{options(section , :margin , :background )} .flex.justify-center.h-60.w-full.overflow-hidden{order_option(section, "lg:w-1/3")} = image_for(section ,"object-cover") - .columns-1.md:columns-2.max-w-full.items-center.w-full.max-w.px-6.mt-6.mx-auto{:class => "lg:w-2/3"} - .flex-1{text_color_option(section)} - %h2.text-4xl.font-bold.text-center.mb-4.lg:mb-8= section.header - -if section.has_option?("subheader") - %h4.text-xl.mt-4.lg:mt-8.md:text-2xl - = section.option("subheader") - .mt-3{ prose_classes } - = markdown(section) - =view_button(section , "my-2") + .columns-1.md:columns-2.max-w-full.items-center.w-full.max-w.px-6.mx-auto.mt-6.lg:mt-0{text_color_option(section, "lg:w-2/3")} + %h2.text-4xl.font-bold.text-left.mb-4.lg:mb-8{text_align_option(section)}= section.header + -if section.has_option?("subheader") + %h4.text-xl.mt-4.lg:mt-8.md:text-2xl{text_align_option(card)} + = section.option("subheader") + .mt-3{ prose_classes } + = markdown(section) + =view_button(section , "my-2") diff --git a/app/views/merged/view/cards/_card_wide_square.haml b/app/views/merged/view/cards/_card_wide_square.haml index 9a318eb..42e1abe 100644 --- a/app/views/merged/view/cards/_card_wide_square.haml +++ b/app/views/merged/view/cards/_card_wide_square.haml @@ -4,5 +4,5 @@ %h3.px-4.mt-2.text-2xl.font-bold= card.header -if card.has_option?("subheader") %h4.p-4.text-xl= card.option("subheader") - .pose.mt-2.p-4= markdown(card) + .mt-2.p-4{prose_classes}= markdown(card) =view_button(card , "mb-2") diff --git a/config/merged/section_styles.yml b/config/merged/section_styles.yml index c0e4c3f..c8dc7a4 100644 --- a/config/merged/section_styles.yml +++ b/config/merged/section_styles.yml @@ -137,6 +137,7 @@ - margin - order - text_color + - text_align - background - button_link - button_text diff --git a/lib/merged/shared_helper.rb b/lib/merged/shared_helper.rb index 0990fe9..6a0bb8c 100644 --- a/lib/merged/shared_helper.rb +++ b/lib/merged/shared_helper.rb @@ -12,7 +12,7 @@ module Merged end def prose_classes - classes = "prose lg:prose-lg " + classes = "prose md:prose-lg lg:prose-xl max-w-none " classes += "prose-headings:text-inherit " { class: classes } end