From 4e2c0c968792f1b2710152f6b56955c79c422385 Mon Sep 17 00:00:00 2001 From: Torsten Date: Tue, 10 Jan 2023 11:39:21 +0200 Subject: [PATCH] minor --- app/assets/stylesheets/merged.tailwind.css | 4 + app/assets/stylesheets/merged/merged.css | 106 ++++++++++----------- app/helpers/merged/pages_helper.rb | 8 +- app/views/merged/pages/show.haml | 2 +- app/views/merged/sections/index.haml | 2 +- app/views/merged/sections/show.haml | 1 + 6 files changed, 61 insertions(+), 62 deletions(-) diff --git a/app/assets/stylesheets/merged.tailwind.css b/app/assets/stylesheets/merged.tailwind.css index b5c61c9..aed2e91 100644 --- a/app/assets/stylesheets/merged.tailwind.css +++ b/app/assets/stylesheets/merged.tailwind.css @@ -1,3 +1,7 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.prose{ + color: inherit; +} diff --git a/app/assets/stylesheets/merged/merged.css b/app/assets/stylesheets/merged/merged.css index cebaf3a..9438e09 100644 --- a/app/assets/stylesheets/merged/merged.css +++ b/app/assets/stylesheets/merged/merged.css @@ -1389,19 +1389,19 @@ select { margin: 1rem; } -.my-3 { - margin-top: 0.75rem; - margin-bottom: 0.75rem; -} - .mx-20 { margin-left: 5rem; margin-right: 5rem; } -.my-10 { - margin-top: 2.5rem; - margin-bottom: 2.5rem; +.my-6 { + margin-top: 1.5rem; + margin-bottom: 1.5rem; +} + +.my-3 { + margin-top: 0.75rem; + margin-bottom: 0.75rem; } .mx-2 { @@ -1414,21 +1414,26 @@ select { margin-right: auto; } -.my-4 { - margin-top: 1rem; - margin-bottom: 1rem; -} - .mx-4 { margin-left: 1rem; margin-right: 1rem; } +.my-4 { + margin-top: 1rem; + margin-bottom: 1rem; +} + .mx-40 { margin-left: 10rem; margin-right: 10rem; } +.my-10 { + margin-top: 2.5rem; + margin-bottom: 2.5rem; +} + .mx-0 { margin-left: 0px; margin-right: 0px; @@ -1464,19 +1469,10 @@ select { margin-right: 1.5rem; } -.my-6 { - margin-top: 1.5rem; - margin-bottom: 1.5rem; -} - .mr-3 { margin-right: 0.75rem; } -.ml-20 { - margin-left: 5rem; -} - .mt-2 { margin-top: 0.5rem; } @@ -1485,10 +1481,18 @@ select { margin-top: 0.25rem; } +.mb-2 { + margin-bottom: 0.5rem; +} + .mt-4 { margin-top: 1rem; } +.mt-6 { + margin-top: 1.5rem; +} + .mt-3 { margin-top: 0.75rem; } @@ -1509,6 +1513,10 @@ select { margin-bottom: 0px; } +.ml-20 { + margin-left: 5rem; +} + .mr-10 { margin-right: 2.5rem; } @@ -1533,12 +1541,8 @@ select { margin-right: 0.5rem; } -.mt-6 { - margin-top: 1.5rem; -} - -.mb-2 { - margin-bottom: 0.5rem; +.mb-10 { + margin-bottom: 2.5rem; } .mt-16 { @@ -1549,10 +1553,6 @@ select { margin-top: 2.5rem; } -.mb-10 { - margin-bottom: 2.5rem; -} - .mb-6 { margin-bottom: 1.5rem; } @@ -1873,6 +1873,10 @@ select { gap: 1rem; } +.gap-8 { + gap: 2rem; +} + .gap-10 { gap: 2.5rem; } @@ -1885,14 +1889,6 @@ select { gap: 3rem; } -.gap-8 { - gap: 2rem; -} - -.gap-20 { - gap: 5rem; -} - .space-y-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))); @@ -2161,11 +2157,6 @@ select { background-color: transparent; } -.bg-orange-200 { - --tw-bg-opacity: 1; - background-color: rgb(254 215 170 / var(--tw-bg-opacity)); -} - .bg-blue-200 { --tw-bg-opacity: 1; background-color: rgb(191 219 254 / var(--tw-bg-opacity)); @@ -2271,9 +2262,9 @@ select { padding-right: 5rem; } -.py-10 { - padding-top: 2.5rem; - padding-bottom: 2.5rem; +.py-6 { + padding-top: 1.5rem; + padding-bottom: 1.5rem; } .px-3 { @@ -2291,16 +2282,16 @@ select { padding-bottom: 2rem; } -.px-2 { - padding-left: 0.5rem; - padding-right: 0.5rem; -} - .px-5 { padding-left: 1.25rem; padding-right: 1.25rem; } +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + .py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; @@ -2336,11 +2327,6 @@ select { padding-bottom: 1rem; } -.py-6 { - padding-top: 1.5rem; - padding-bottom: 1.5rem; -} - .pr-12 { padding-right: 3rem; } @@ -2591,6 +2577,10 @@ select { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); } +.prose{ + color: inherit; +} + .hover\:scale-105:hover { --tw-scale-x: 1.05; --tw-scale-y: 1.05; diff --git a/app/helpers/merged/pages_helper.rb b/app/helpers/merged/pages_helper.rb index b76bfe5..713030d 100644 --- a/app/helpers/merged/pages_helper.rb +++ b/app/helpers/merged/pages_helper.rb @@ -1,8 +1,12 @@ module Merged module PagesHelper - def last_blog + def self.last_blog blog = Page.where(type: :blog).order(updated_at: :asc).first - blog&.sections.last + return nil unless blog + blog.sections.last + end + def last_blog + self.class.last_blog end def header_list diff --git a/app/views/merged/pages/show.haml b/app/views/merged/pages/show.haml index 1910e44..5274c57 100644 --- a/app/views/merged/pages/show.haml +++ b/app/views/merged/pages/show.haml @@ -3,7 +3,7 @@ = @page.type.capitalize .text-xl.font-bold.text-gray-900 =@page.name - %strong.rounded.bg-green-100.px-3.text-xs.font-medium.text-green-700{:class => "py-1.5"} + %strong.rounded.bg-green-100.px-4.py-2.text-lg.font-medium.text-green-700{:class => "py-1.5"} = link_to 'Sections', merged.page_sections_path(@page.id) .text-xl= distance_of_time_in_words_to_now(@page.updated_at) diff --git a/app/views/merged/sections/index.haml b/app/views/merged/sections/index.haml index 5b5d1ae..c29852e 100644 --- a/app/views/merged/sections/index.haml +++ b/app/views/merged/sections/index.haml @@ -8,7 +8,7 @@ -@page.sections.each do |section | .flex.gap-10.mt-2{class: (section.index%2)==1 ? 'bg-cyan-50' : 'bg-red-50' , id: "section_#{section.id}"} - .basis-72.mx-20 + .basis-72.ml-20 %h3.mt-4.text-lg.font-bold Section #{section.index} : #{section.header} .flex.flex-wrap = yellow_button("Edit" , merged.section_path(section.id) ) diff --git a/app/views/merged/sections/show.haml b/app/views/merged/sections/show.haml index a48a916..9207a31 100644 --- a/app/views/merged/sections/show.haml +++ b/app/views/merged/sections/show.haml @@ -1,5 +1,6 @@ .mx-20.flex.h-16.items-center.gap-16 = render "sections_pagination" , section: @section + = link_to( "New Section" , merged.new_page_section_path(@section.page.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)