Commit 1da8268c03f9e85e05f3212571f9e3e2b3ca4264

Authored by Francisco Marcelo de Araújo Lima Júnior
1 parent b6d443cb

improvements on embed block

app/helpers/boxes_helper.rb
... ... @@ -219,10 +219,8 @@ module BoxesHelper
219 219 buttons << thickbox_inline_popup_icon(:help, _('Help on this block'), {}, "help-on-box-#{block.id}") << content_tag('div', content_tag('h2', _('Help')) + content_tag('div', block.help, :style => 'margin-bottom: 1em;') + thickbox_close_button(_('Close')), :style => 'display: none;', :id => "help-on-box-#{block.id}")
220 220 end
221 221  
222   - #if block.respond_to?(:embedable)
223   - if true
224   -
225   - url = url_for :controller => 'embed', :action => 'embed_block', :id => block.id, :only_path => false;
  222 + if block.respond_to?(:embedable)
  223 + url = url_for :controller => 'embed', :action => 'index', :id => block.id, :only_path => false;
226 224  
227 225 html = content_tag('div',
228 226 content_tag('h2', _('Embed block code')) +
... ...
app/models/block.rb
... ... @@ -16,6 +16,10 @@ class Block &lt; ActiveRecord::Base
16 16  
17 17 named_scope :enabled, :conditions => { :enabled => true }
18 18  
  19 + def embedable
  20 + true
  21 + end
  22 +
19 23 def embed_code(url)
20 24 html = "<iframe src='#{url}?source=SOURCE_NAME' frameborder='0' allowfullscreen ></iframe>"
21 25 end
... ...