From b5c35ab4a4cfaf6a06ea8ec6ed2104990aa0ccdd Mon Sep 17 00:00:00 2001 From: Torsten Date: Wed, 7 Dec 2022 14:15:08 +0200 Subject: [PATCH] more card wittling --- app/assets/images/merged/merged_logo.png | Bin 0 -> 7226 bytes app/views/layouts/merged_layout.haml | 5 +++++ app/views/merged/cards/select_image.haml | 1 + app/views/merged/sections/index.html.haml | 2 +- app/views/merged/sections/show.html.haml | 4 ++-- .../merged/view/cards/_card_full_image.haml | 14 ++++++++------ app/views/merged/view/elements/_button.haml | 4 ++-- lib/merged/engine.rb | 2 +- 8 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 app/assets/images/merged/merged_logo.png diff --git a/app/assets/images/merged/merged_logo.png b/app/assets/images/merged/merged_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e047800aa25de0d2b674f7156eca73345d255419 GIT binary patch literal 7226 zcmb7JWmMD+v;RwjbR*$PEZq$v4K6GV(y+jSgf!9!E-hUGONS`kCDMqyh;$0lNC?s$ zd!Oe$@3~*@r#m0!%=~7~nR9+~WT0W#5IrIS0DuJYTty!Mu)qND;1>b*KL|^; zlITBIY2K22*CiwFn~)J&?^9(Mgf~{K*|H~Tm~RXfN3odZ~y{<0Db^a1^`n4pap;@ z03Zbb4*@_M00IFZ3IG}aAO!$E0)RUJzyTl^Ncxqe@KqsnE)+Hj>)z{LK3fKT0gWDw z9$X(3tQFL5)e7|p=?>|Vw~~8Id4MPZ4|$;07FZ4eFiF5c6wvJgB81(_d zo&)5BfC4*EUB_PGHUFQI#Vk6OLLS-c5ouNgy1ds3 zlIEfn{gaqEpR3)M312?|xvgbB-VC)7p?#@Dzc{)^6sK~)6Dn1Xv!$8ZbI8I2S{&`s z`#LK%3twU5qfsJE;c*G=5S)Z3e}V-$VfCxSE7ISv+T2UJ2Ht8RiG!^~G0-83Go@BMf2WS)-gm z>0s>1-GK|TDDQyMCz}#gSilms*HwHrw2wfVTopgT)t#&C-7w>4UFoq{~XZ`9yktx1>7nSiD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L|D^Na6Auo$QuGH* P{u_d*YOB;J!4UrgMnjA3 literal 0 HcmV?d00001 diff --git a/app/views/layouts/merged_layout.haml b/app/views/layouts/merged_layout.haml index 96207a2..440fc13 100644 --- a/app/views/layouts/merged_layout.haml +++ b/app/views/layouts/merged_layout.haml @@ -19,6 +19,11 @@ %span.sr-only Home %svg.h-8{:fill => "none", :viewbox => "0 0 28 24", :xmlns => "http://www.w3.org/2000/svg"} %path{:d => "M0.41 10.3847C1.14777 7.4194 2.85643 4.7861 5.2639 2.90424C7.6714 1.02234 10.6393 0 13.695 0C16.7507 0 19.7186 1.02234 22.1261 2.90424C24.5336 4.7861 26.2422 7.4194 26.98 10.3847H25.78C23.7557 10.3549 21.7729 10.9599 20.11 12.1147C20.014 12.1842 19.9138 12.2477 19.81 12.3047H19.67C19.5662 12.2477 19.466 12.1842 19.37 12.1147C17.6924 10.9866 15.7166 10.3841 13.695 10.3841C11.6734 10.3841 9.6976 10.9866 8.02 12.1147C7.924 12.1842 7.8238 12.2477 7.72 12.3047H7.58C7.4762 12.2477 7.376 12.1842 7.28 12.1147C5.6171 10.9599 3.6343 10.3549 1.61 10.3847H0.41ZM23.62 16.6547C24.236 16.175 24.9995 15.924 25.78 15.9447H27.39V12.7347H25.78C24.4052 12.7181 23.0619 13.146 21.95 13.9547C21.3243 14.416 20.5674 14.6649 19.79 14.6649C19.0126 14.6649 18.2557 14.416 17.63 13.9547C16.4899 13.1611 15.1341 12.7356 13.745 12.7356C12.3559 12.7356 11.0001 13.1611 9.86 13.9547C9.2343 14.416 8.4774 14.6649 7.7 14.6649C6.9226 14.6649 6.1657 14.416 5.54 13.9547C4.4144 13.1356 3.0518 12.7072 1.66 12.7347H0V15.9447H1.61C2.39051 15.924 3.154 16.175 3.77 16.6547C4.908 17.4489 6.2623 17.8747 7.65 17.8747C9.0377 17.8747 10.392 17.4489 11.53 16.6547C12.1468 16.1765 12.9097 15.9257 13.69 15.9447C14.4708 15.9223 15.2348 16.1735 15.85 16.6547C16.9901 17.4484 18.3459 17.8738 19.735 17.8738C21.1241 17.8738 22.4799 17.4484 23.62 16.6547ZM23.62 22.3947C24.236 21.915 24.9995 21.664 25.78 21.6847H27.39V18.4747H25.78C24.4052 18.4581 23.0619 18.886 21.95 19.6947C21.3243 20.156 20.5674 20.4049 19.79 20.4049C19.0126 20.4049 18.2557 20.156 17.63 19.6947C16.4899 18.9011 15.1341 18.4757 13.745 18.4757C12.3559 18.4757 11.0001 18.9011 9.86 19.6947C9.2343 20.156 8.4774 20.4049 7.7 20.4049C6.9226 20.4049 6.1657 20.156 5.54 19.6947C4.4144 18.8757 3.0518 18.4472 1.66 18.4747H0V21.6847H1.61C2.39051 21.664 3.154 21.915 3.77 22.3947C4.908 23.1889 6.2623 23.6147 7.65 23.6147C9.0377 23.6147 10.392 23.1889 11.53 22.3947C12.1468 21.9165 12.9097 21.6657 13.69 21.6847C14.4708 21.6623 15.2348 21.9135 15.85 22.3947C16.9901 23.1884 18.3459 23.6138 19.735 23.6138C21.1241 23.6138 22.4799 23.1884 23.62 22.3947Z", :fill => "currentColor"} + .flex-1.md:flex.md:items-center.md:gap-12 + %a.block.text-teal-600{:href => "/merged/pages"} + %span.sr-only Home + =image_tag("merged/merged_logo" , class: "h-20") + .md:flex.md:items-center.md:gap-12 %nav.hidden.md:block{"aria-label" => "Site Nav"} %ul.flex.items-center.gap-6.text-sm diff --git a/app/views/merged/cards/select_image.haml b/app/views/merged/cards/select_image.haml index b67dee4..9976c9b 100644 --- a/app/views/merged/cards/select_image.haml +++ b/app/views/merged/cards/select_image.haml @@ -13,3 +13,4 @@ .relative.block.border.border-gray-100 = link_to( card_set_image_path( image: name)) do =image_tag("#{image_root}/#{name}" , class: "h-56 w-full object-contain lg:h-72") + = image.name diff --git a/app/views/merged/sections/index.html.haml b/app/views/merged/sections/index.html.haml index 65e1633..1961bff 100644 --- a/app/views/merged/sections/index.html.haml +++ b/app/views/merged/sections/index.html.haml @@ -11,7 +11,7 @@ -@page.sections.each do |section | .grid.grid-cols-5.gap-2.m-8{class: (section.index%2)==1 ? 'bg-cyan-50' : 'bg-red-50' } .relative.block.border.border-gray-100.p-4 - %h3.mt-4.text-lg.font-bold Section #{section.index + 1} + %h3.mt-4.text-lg.font-bold Section #{section.index + 1} : #{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) ) diff --git a/app/views/merged/sections/show.html.haml b/app/views/merged/sections/show.html.haml index fd9bbe5..ff984f3 100644 --- a/app/views/merged/sections/show.html.haml +++ b/app/views/merged/sections/show.html.haml @@ -10,7 +10,7 @@ %h3.text-xl.font-bold.tracking-tight.text-gray-900 Section #{@section.index + 1} / #{@section.page.sections.length} - unless @section.index == 0 - =link_to "(prev)" , section_url(@section.previous_section.id) + =link_to "(prev)" , section_url(@section.previous_section.id) - unless @section.index == (@section.page.sections.length - 1) =link_to "(next)" , section_url(@section.next_section.id) .grid.grid-cols-3.gap-2.m-8 @@ -18,7 +18,7 @@ %h3.mt-4.text-lg.font-bold Template #{@section.template} = section_preview(@section , class: "w-full object-contain p-3") = yellow_button( "Change Template" , section_select_template_url(@section.id)) - = green_button( "New Section" , new_page_section_url(@section.page.name) ) + = green_button( "New Section" , new_page_section_url(@section.page.name , template: @section.template) ) .relative.block.border.border-gray-100 = section_form( class: "mx-auto mt-8 mb-0 max-w space-y-4") do diff --git a/app/views/merged/view/cards/_card_full_image.haml b/app/views/merged/view/cards/_card_full_image.haml index dca57d8..747aa9f 100644 --- a/app/views/merged/view/cards/_card_full_image.haml +++ b/app/views/merged/view/cards/_card_full_image.haml @@ -1,7 +1,9 @@ -.group.m-8.overflow-hidden.relative.flex.h-96.items-end.bg-black +.group.m-8.overflow-hidden.relative.flex.h-96.items-end = image_for( card , "absolute inset-0 h-full w-full object-cover hover:scale-110 ease-in duration-700") - .relative.w-full.bg-cyan-600.m-2.p-4.text-center.tracking-widest.text-white.transition-colors.group-hover:bg-cyan-700{:class => "sm:w-1/2"} - %h3.text-lg.uppercase - = card.header - %p.mt-1.text-xs.font-medium - = card.text + .relative.w-full.m-2.p-4.tracking-widest{align_option(card ,"sm:w-1/2")} + %div.transition-colors.group-hover:bg-black.group-hover:text-white{options(card , :align , :color , :background)} + .relative.w-full.m-2.p-4 + %h3.text-lg + = card.header + %p.mt-1.text-xs.font-medium + = card.text diff --git a/app/views/merged/view/elements/_button.haml b/app/views/merged/view/elements/_button.haml index db78f17..6e04fd0 100644 --- a/app/views/merged/view/elements/_button.haml +++ b/app/views/merged/view/elements/_button.haml @@ -1,2 +1,2 @@ -- unless section.has_option?("button_text") and section.has_option?("button_link") - = blue_button( section.button_text , section.button_link) +- if section.has_option?("button_text") and section.has_option?("button_link") + = blue_button( section.option("button_text") , section.option("button_link")) diff --git a/lib/merged/engine.rb b/lib/merged/engine.rb index 89f3b7b..69c5d1b 100644 --- a/lib/merged/engine.rb +++ b/lib/merged/engine.rb @@ -2,7 +2,7 @@ module Merged class Engine < ::Rails::Engine isolate_namespace Merged initializer "merged.assets.precompile" do |app| - app.config.assets.precompile += %w( config/merged_manifest.js ) + app.config.assets.precompile += %w( config/merged_manifest.js merged/merged_logo) add_image_assets(app.config , "section_preview") add_image_assets(app.config , "card_preview") end