Sha256: 166669718204811055d44db577c62effd8c03ba67c8258f1c3a57892f5d25325
Contents?: true
Size: 2 KB
Versions: 7
Compression:
Stored size: 2 KB
Contents
module PageHelper def inline_editable(template_content_key, placeholder='', default_content='') if @object if placeholder.empty? placeholder = template_content_key + '...' end page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """<span class='character-editor' data-input-name='#{class_underscore}[template_content][#{ template_content_key }]' data-options=\"placeholder:'#{ placeholder }';disableReturn:true;disableToolbar:true;\" >#{ content }</span>""".html_safe else content.html_safe end end end def editable(template_content_key, placeholder='', default_content='') if @object if placeholder.empty? placeholder = template_content_key + '...' end page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """<div class='character-editor' data-input-name='#{class_underscore}[template_content][#{ template_content_key }]' data-options=\"placeholder:'#{ placeholder }';targetBlanks:true;\" >#{ content }</div>""".html_safe else content.html_safe end end end def redactor(template_content_key, default_content='') if @object page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """<textarea id='redactor' class='character-redactor' placeholder='Type text here...'>#{ content }</textarea>""".html_safe else content.html_safe end end end def settings(group, name) ::Settings.group(group)[name].value end end
Version data entries
7 entries across 7 versions & 1 rubygems