fixing demo errors, rename template to style
This commit is contained in:
parent
693d121c0f
commit
9bcd43215b
@ -45,7 +45,7 @@ module Merged
|
||||
@card.option_definitions.each do |option|
|
||||
@card.set_option(option.name, options[option.name])
|
||||
end if options
|
||||
@card.save(current_member.email)
|
||||
@card.edit_save(current_member.email)
|
||||
redirect_to section_cards_url(@card.section.id) , notice: "Updated #{@card.header}"
|
||||
end
|
||||
|
||||
|
@ -53,7 +53,7 @@ module Merged
|
||||
end
|
||||
|
||||
def destroy
|
||||
@page.delete()
|
||||
@page.delete_save!
|
||||
redirect_to pages_url, notice: "Page #{@page.name} was removed."
|
||||
end
|
||||
|
||||
|
@ -27,7 +27,7 @@ module Merged
|
||||
end
|
||||
|
||||
def destroy
|
||||
@section.delete
|
||||
@section.delete_save!
|
||||
redirect_to page_sections_url(@section.page.id) , notice: "Section #{@section.header} removed"
|
||||
end
|
||||
|
||||
|
@ -5,7 +5,8 @@ module Merged
|
||||
def rows( text )
|
||||
return 5 if text.blank?
|
||||
text = text.text unless text.is_a?(String)
|
||||
rows = (text.length / 60).to_i
|
||||
return 5 if text.blank?
|
||||
rows = (text.length / 50).to_i
|
||||
return 5 if rows < 5
|
||||
rows
|
||||
end
|
||||
|
@ -12,6 +12,7 @@ module Merged
|
||||
end
|
||||
|
||||
def zero
|
||||
[Page, Section, Card].each { |m| m.reload(true) }
|
||||
@adds = []
|
||||
@edits = []
|
||||
@deletes = []
|
||||
|
@ -41,9 +41,9 @@
|
||||
=submit_button( "Delete" , true)
|
||||
|
||||
.basis-72
|
||||
%h3.mt-4.text-lg.font-bold Template
|
||||
%h3.mt-4.text-lg.font-bold Style
|
||||
= link_to(merged.section_select_template_path(section.id)) do
|
||||
%p= section.template
|
||||
%p= section.template_style.header
|
||||
= section_preview(section , class: "object-contain")
|
||||
.basis-52.grow
|
||||
%h3.mt-4.text-lg.font-bold Header
|
||||
|
@ -2,7 +2,7 @@
|
||||
.text-xl.font-bold.text-gray-900
|
||||
Page #{link_to @section.page.name, merged.page_sections_path(@section.page.id), class: "underline"}
|
||||
.text-xl.text-gray-900
|
||||
Select Card Template for Section #{@section.index} - #{@section.header}
|
||||
Select Card Style for Section #{@section.index} - #{@section.header}
|
||||
|
||||
= render "layouts/merged_header"
|
||||
.grid.grid-cols-4.gap-6.m-8
|
||||
|
@ -2,7 +2,7 @@
|
||||
.text-xl.font-bold.text-gray-900
|
||||
Page #{link_to @section.page.name, merged.page_sections_path(@section.page.id), class: "underline"}
|
||||
.text-xl.text-gray-900
|
||||
Select Template for Section #{@section.index} - #{@section.header}
|
||||
Select Style for Section #{@section.index} - #{@section.header}
|
||||
|
||||
= render "layouts/merged_header"
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
.flex.gap-4.m-8.flex-wrap
|
||||
.basis-96
|
||||
%h3.mt-4.text-lg.font-bold Template #{@section.template}
|
||||
%h3.mt-4.text-lg.font-bold= @section.template_style.header
|
||||
= section_preview(@section , class: "w-full object-contain my-4")
|
||||
= yellow_button( "Change Template" , merged.section_select_template_path(@section.id))
|
||||
= yellow_button( "Change Style" , merged.section_select_template_path(@section.id))
|
||||
= green_button( "New Section" , merged.new_page_section_path(@section.page.id , template: @section.template) )
|
||||
.basis-full.mt-3
|
||||
Updated at:
|
||||
@ -48,10 +48,10 @@
|
||||
- if( @section.has_cards? )
|
||||
.basis-full.h-0
|
||||
.basis-96
|
||||
.mx-3.text-lg.font-bold Card Template #{@section.card_template}
|
||||
.mx-3.text-lg.font-bold Card Style #{@section.card_template}
|
||||
=card_preview(@section , class: "my-3")
|
||||
%p.py-3
|
||||
=yellow_button("Change Card Template", merged.section_select_card_template_path(@section.id))
|
||||
=yellow_button("Change Card Style", merged.section_select_card_template_path(@section.id))
|
||||
|
||||
.basis-96.grow
|
||||
%h3.mt-4.text-lg.font-bold #{@section.cards.length} Cards
|
||||
|
@ -10,9 +10,6 @@
|
||||
= section.option("subheader")
|
||||
%p.prose.mt-8.md:block
|
||||
= markdown(section)
|
||||
-if section.has_option?("text")
|
||||
%p.prose.mt-8.md:block
|
||||
= markdown section.option("text")
|
||||
-if section.has_option?("button_text")
|
||||
.mt-8.md:mt-8
|
||||
= render 'merged/view/elements/button' , section: section
|
||||
|
@ -51,7 +51,6 @@
|
||||
- background
|
||||
- color
|
||||
- subheader
|
||||
- text
|
||||
- text_align
|
||||
- button_link
|
||||
- button_text
|
||||
|
Loading…
Reference in New Issue
Block a user