fix updated_by

This commit is contained in:
Torsten 2023-01-25 01:16:05 +02:00
parent 3660f9e8e2
commit bafe142a3b
10 changed files with 121 additions and 18 deletions

View File

@ -1376,6 +1376,18 @@ select {
z-index: -10;
}
.order-last {
order: 9999;
}
.order-2 {
order: 2;
}
.order-3 {
order: 3;
}
.col-span-2 {
grid-column: span 2 / span 2;
}
@ -1609,6 +1621,10 @@ select {
margin-top: 5rem;
}
.ml-0 {
margin-left: 0px;
}
.block {
display: block;
}
@ -1773,6 +1789,10 @@ select {
max-width: 28rem;
}
.max-w-\[1920px\] {
max-width: 1920px;
}
.flex-1 {
flex: 1 1 0%;
}
@ -1949,6 +1969,10 @@ select {
gap: 3rem;
}
.gap-5 {
gap: 1.25rem;
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
@ -2325,6 +2349,11 @@ select {
object-fit: cover;
}
.object-fill {
-o-object-fit: fill;
object-fit: fill;
}
.p-4 {
padding: 1rem;
}
@ -2477,6 +2506,10 @@ select {
text-align: right;
}
.align-bottom {
vertical-align: bottom;
}
.text-lg {
font-size: 1.125rem;
line-height: 1.75rem;
@ -2873,10 +2906,6 @@ select {
}
@media (min-width: 768px) {
.md\:order-last {
order: 9999;
}
.md\:m-12 {
margin: 3rem;
}
@ -2936,6 +2965,14 @@ select {
gap: 2rem;
}
.md\:gap-12 {
gap: 3rem;
}
.md\:gap-10 {
gap: 2.5rem;
}
.md\:p-12 {
padding: 3rem;
}
@ -2979,6 +3016,26 @@ select {
margin-right: 5rem;
}
.lg\:mx-0 {
margin-left: 0px;
margin-right: 0px;
}
.lg\:mx-1 {
margin-left: 0.25rem;
margin-right: 0.25rem;
}
.lg\:mx-2 {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
.lg\:mx-10 {
margin-left: 2.5rem;
margin-right: 2.5rem;
}
.lg\:mb-8 {
margin-bottom: 2rem;
}
@ -2995,6 +3052,14 @@ select {
margin-bottom: 0px;
}
.lg\:ml-10 {
margin-left: 2.5rem;
}
.lg\:mt-6 {
margin-top: 1.5rem;
}
.lg\:h-96 {
height: 24rem;
}
@ -3048,6 +3113,14 @@ select {
gap: 3rem;
}
.lg\:gap-20 {
gap: 5rem;
}
.lg\:gap-16 {
gap: 4rem;
}
.lg\:px-8 {
padding-left: 2rem;
padding-right: 2rem;
@ -3070,6 +3143,24 @@ select {
}
@media (min-width: 1280px) {
.xl\:mx-auto {
margin-left: auto;
margin-right: auto;
}
.xl\:mx-0 {
margin-left: 0px;
margin-right: 0px;
}
.xl\:w-3\/5 {
width: 60%;
}
.xl\:w-2\/5 {
width: 40%;
}
.xl\:columns-4 {
-moz-columns: 4;
columns: 4;
@ -3078,6 +3169,14 @@ select {
.xl\:grid-cols-6 {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
.xl\:flex-row {
flex-direction: row;
}
.xl\:gap-16 {
gap: 4rem;
}
}
@media (min-width: 1536px) {

View File

@ -19,7 +19,7 @@ module Merged
else
@card.move_down
end
@card.edit_save(current_member)
@card.edit_save(current_member.email)
redirect_to section_cards_url(@card.section.id),notice: "#{@card.header} moved"
end

View File

@ -67,14 +67,10 @@ module Merged
def get_images
images = Image.all
puts "Images #{images.length}"
return images unless params[:unused]
hash = images.collect{|i| [i.id , i ] }.to_h
puts "Images1 #{hash.length}"
Section.all.each{ |s| hash.delete(s.image&.id)}
puts "Images2 #{hash.length}"
Card.all.each{ |s| hash.delete(s.image&.id)}
puts "Images3 #{hash.length}"
hash.values
end
def set_image

View File

@ -4,6 +4,13 @@ module Merged
include OptionsHelper
include SharedHelper
def updated_by(owner)
member = owner.updated_by
return member if member.is_a? String
return "" if member.nil?
return member.name if member.respond_to? :name
member.email
end
def aspect_ratio image
x , y = image.aspect_ratio
"#{x} / #{y}"

View File

@ -38,7 +38,7 @@ module Merged
def order_option(section , clazz = "")
if section.has_option?("order")
clazz += " md:order-last" if section.option('order') == "right"
clazz += " order-last" if section.option('order') == "right"
end
{class: clazz}
end
@ -125,6 +125,7 @@ module Merged
else # two
columns = "grid-cols-1 md:grid-cols-2"
end
columns += " gap-8 md:gap-12 lg:gap-16"
{class: columns }
end

View File

@ -33,8 +33,6 @@ module Merged
def view_button(element , extra_classes = "")
return "" unless element.has_option?("button_link")
puts element.header
puts element.option("button_link")
["<button class='button ",
extra_classes,
"'>" ,

View File

@ -12,7 +12,7 @@
- if false
%script{:src => "https://cdn.tailwindcss.com"}
%body.max-w-screen-2xl.2xl:mx-auto
%body
= render "layouts/merged/header"
= render "layouts/merged/messages"
= yield

View File

@ -5,7 +5,8 @@
Cards
= link_to( "New Card" , merged.new_section_card_path(@section.id) , class: "p-2 border border-gray-200 bg-cyan-100 font-bold rounded-lg hover:bg-sky-100")
= render_section( @section )
.xl:mx-auto{class: "max-w-[1920px]"}
= render_section( @section )
- @section.cards.each_with_index do |card , index|
.flex.gap-10.px-20.pt-4.pb-2.mb-2.border.border-2.bg-neutral-50.border-slate-400{ id: "card_#{card.id}"}
@ -27,7 +28,7 @@
= distance_of_time_in_words_to_now(card.updated_at)
.basis-full.mb-3
Updated by:
= card.updated_by
= updated_by(card)
.basis-full.mb-3
= form_for( card , {method: :delete } ) do
%button.button.remove.mt-4{type: :submit} Delete Card

View File

@ -29,7 +29,7 @@
= distance_of_time_in_words_to_now(section.updated_at)
.basis-full.mb-3
Updated by:
= section.updated_by
= updated_by(section)
- if section.has_cards?
- if card = section.cards_update
.basis-full

View File

@ -3,7 +3,8 @@
= link_to( merged.new_page_section_path(@section.page.id) ) do
.button.change New Section
= render_section( @section )
.xl:mx-auto{class: "max-w-[1920px]"}
= render_section( @section )
.flex.gap-8.my-10.flex-wrap.mx-20
.basis-80
@ -18,7 +19,7 @@
= distance_of_time_in_words_to_now(@section.updated_at)
.basis-full.mb-3
Updated by:
= @section.updated_by
= updated_by(@section)
= simple_form_for( @section , method: :patch ) do |f|
= f.input :page_id , label: "move to page" , include_blank: false ,
collection: Merged::Page.all.collect{|p| [p.name , p.id]}