saving updated_by
This commit is contained in:
parent
f46634e3d1
commit
ab43a2ed0a
@ -38,14 +38,13 @@ module Merged
|
|||||||
@card.allowed_fields.each do |key|
|
@card.allowed_fields.each do |key|
|
||||||
if( params.has_key?(key) )
|
if( params.has_key?(key) )
|
||||||
@card.update(key, params[key])
|
@card.update(key, params[key])
|
||||||
puts "updating:#{key}=#{params[key]}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
options = params[:option]
|
options = params[:option]
|
||||||
@card.option_definitions.each do |option|
|
@card.option_definitions.each do |option|
|
||||||
@card.set_option(option.name, options[option.name])
|
@card.set_option(option.name, options[option.name])
|
||||||
end if options
|
end if options
|
||||||
@card.save(current_member)
|
@card.save(current_member.email)
|
||||||
redirect_to section_cards_url(@card.section.id) , notice: "Updated #{@card.header}"
|
redirect_to section_cards_url(@card.section.id) , notice: "Updated #{@card.header}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -15,6 +15,18 @@ module Merged
|
|||||||
Section.where(page_id: id).order(index: :asc)
|
Section.where(page_id: id).order(index: :asc)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def section_update
|
||||||
|
last = Time.now
|
||||||
|
last_section = nil
|
||||||
|
sections.each do |section|
|
||||||
|
if( section.updated_at < last )
|
||||||
|
last = section.updated_at
|
||||||
|
last_section = section
|
||||||
|
end
|
||||||
|
end
|
||||||
|
last_section
|
||||||
|
end
|
||||||
|
|
||||||
def template_style
|
def template_style
|
||||||
PageStyle.find_by_type( type )
|
PageStyle.find_by_type( type )
|
||||||
end
|
end
|
||||||
|
@ -22,27 +22,38 @@
|
|||||||
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
||||||
.flex.items-center.gap-2
|
.flex.items-center.gap-2
|
||||||
Edited by
|
Edited by
|
||||||
|
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
||||||
|
.flex.items-center.gap-2
|
||||||
|
Sections at
|
||||||
|
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
||||||
|
.flex.items-center.gap-2
|
||||||
|
Sections by
|
||||||
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
%th.whitespace-nowrap.px-4.py-2.text-left.font-medium.text-gray-900
|
||||||
.flex.items-center.gap-2
|
.flex.items-center.gap-2
|
||||||
Actions
|
Actions
|
||||||
%tbody.divide-y.divide-gray-200
|
%tbody.divide-y.divide-gray-200
|
||||||
- @pages.each do |merged_page|
|
- @pages.each do |page|
|
||||||
%tr{id: merged_page.name}
|
%tr{id: page.name}
|
||||||
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
= link_to merged_page.id , merged.page_path(merged_page.id)
|
= link_to page.id , merged.page_path(page.id)
|
||||||
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
= link_to merged_page.name , merged.page_sections_path(merged_page.id)
|
= link_to page.name , merged.page_sections_path(page.id)
|
||||||
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
= merged_page.sections.length
|
= page.sections.length
|
||||||
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
= distance_of_time_in_words_to_now(merged_page.updated_at)
|
= distance_of_time_in_words_to_now(page.updated_at)
|
||||||
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
ME
|
=page.updated_by
|
||||||
|
- s = page.section_update
|
||||||
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
|
=s.updated_at.to_date
|
||||||
|
%td.whitespace-nowrap.px-4.py-2.text-gray-700
|
||||||
|
=s.updated_by
|
||||||
%td.whitespace-nowrap.px-4.py-2
|
%td.whitespace-nowrap.px-4.py-2
|
||||||
%strong.rounded.bg-green-100.px-3.text-xs.font-medium.text-green-700{:class => "py-1.5"}
|
%strong.rounded.bg-green-100.px-3.text-xs.font-medium.text-green-700{:class => "py-1.5"}
|
||||||
= link_to 'Sections', merged.page_sections_path(merged_page.id)
|
= link_to 'Sections', merged.page_sections_path(page.id)
|
||||||
%strong.rounded.bg-amber-100.px-3.text-xs.font-medium.text-amber-700{:class => "py-1.5"}
|
%strong.rounded.bg-amber-100.px-3.text-xs.font-medium.text-amber-700{:class => "py-1.5"}
|
||||||
= link_to 'Edit', merged.page_path(merged_page.id)
|
= link_to 'Edit', merged.page_path(page.id)
|
||||||
|
|
||||||
.grid.grid-cols-3.gap-2.m-8
|
.grid.grid-cols-3.gap-2.m-8
|
||||||
.relative.block.border.border-gray-100
|
.relative.block.border.border-gray-100
|
||||||
|
@ -22,6 +22,12 @@
|
|||||||
=link_to(merged.section_move_path(section.id , dir: :up)) do
|
=link_to(merged.section_move_path(section.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"}
|
%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"}
|
%path{:d => "M15.75 17.25L12 21m0 0l-3.75-3.75M12 21V3", "stroke-linecap" => "round", "stroke-linejoin" => "round"}
|
||||||
|
.basis-full.mt-3
|
||||||
|
Updated at:
|
||||||
|
= section.updated_at.to_date
|
||||||
|
.basis-full.mb-3
|
||||||
|
Updated by:
|
||||||
|
= section.updated_by
|
||||||
.basis-full.mb-3
|
.basis-full.mb-3
|
||||||
= form_tag( merged.section_path(section.id) , {method: :delete } ) do
|
= form_tag( merged.section_path(section.id) , {method: :delete } ) do
|
||||||
=submit_button( "Delete" , true)
|
=submit_button( "Delete" , true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user