changed the editable inheritance tag to be assignable, avoiding confusion between that and the content tag inheritance
This commit is contained in:
parent
f4c242ce1a
commit
adbae00457
@ -8,7 +8,7 @@ class EditableElement
|
|||||||
field :default_content
|
field :default_content
|
||||||
field :hint
|
field :hint
|
||||||
field :disabled, :type => Boolean, :default => false
|
field :disabled, :type => Boolean, :default => false
|
||||||
field :inheritable, :type => Boolean, :default => true
|
field :assignable, :type => Boolean, :default => true
|
||||||
field :from_parent, :type => Boolean, :default => false
|
field :from_parent, :type => Boolean, :default => false
|
||||||
|
|
||||||
## associations ##
|
## associations ##
|
||||||
|
@ -62,7 +62,7 @@ module Models
|
|||||||
|
|
||||||
def merge_editable_elements_from_page(source)
|
def merge_editable_elements_from_page(source)
|
||||||
source.editable_elements.each do |el|
|
source.editable_elements.each do |el|
|
||||||
next if el.disabled? or !el.inheritable?
|
next if el.disabled? or !el.assignable?
|
||||||
|
|
||||||
existing_el = self.find_editable_element(el.block, el.slug)
|
existing_el = self.find_editable_element(el.block, el.slug)
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ module Locomotive
|
|||||||
def initialize(tag_name, markup, tokens, context)
|
def initialize(tag_name, markup, tokens, context)
|
||||||
if markup =~ Syntax
|
if markup =~ Syntax
|
||||||
@slug = $1.gsub('\'', '')
|
@slug = $1.gsub('\'', '')
|
||||||
@options = { :inheritable => true }
|
@options = { :assignable => true }
|
||||||
markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/^'/, '').gsub(/'$/, '') }
|
markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/^'/, '').gsub(/'$/, '') }
|
||||||
else
|
else
|
||||||
raise ::Liquid::SyntaxError.new("Syntax Error in 'editable_xxx' - Valid syntax: editable_xxx <slug>(, <options>)")
|
raise ::Liquid::SyntaxError.new("Syntax Error in 'editable_xxx' - Valid syntax: editable_xxx <slug>(, <options>)")
|
||||||
@ -27,7 +27,7 @@ module Locomotive
|
|||||||
:slug => @slug,
|
:slug => @slug,
|
||||||
:hint => @options[:hint],
|
:hint => @options[:hint],
|
||||||
:default_content => @nodelist.first.to_s,
|
:default_content => @nodelist.first.to_s,
|
||||||
:inheritable => @options[:inheritable],
|
:assignable => @options[:assignable],
|
||||||
:disabled => false,
|
:disabled => false,
|
||||||
:from_parent => false
|
:from_parent => false
|
||||||
}, document_type)
|
}, document_type)
|
||||||
|
Loading…
Reference in New Issue
Block a user