Commit 7b1a306f6a80bf2cb2152dd2a4bed7204560a962

Authored by Victor Costa
1 parent efcb9970

Display new help view when clicked at block help

app/helpers/boxes_helper.rb
@@ -215,8 +215,11 @@ module BoxesHelper @@ -215,8 +215,11 @@ module BoxesHelper
215 buttons << icon_button(:clone, _('Clone'), { :action => 'clone_block', :id => block.id }, { :method => 'post' }) 215 buttons << icon_button(:clone, _('Clone'), { :action => 'clone_block', :id => block.id }, { :method => 'post' })
216 end 216 end
217 217
218 - if block.respond_to?(:help)  
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}") 218 + unless block.kind_of?(MainBlock)
  219 + buttons << link_to(content_tag('span', _('Help on this block')),
  220 + {:action => 'show_block_type_info', :type => block.class.name},
  221 + :class => "button icon-button icon-help colorbox",
  222 + :title => _('Help on this block'))
220 end 223 end
221 224
222 if block.embedable? 225 if block.embedable?
app/views/box_organizer/show_block_type_info.html.erb
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 <div id="block-info-description"> 15 <div id="block-info-description">
16 <h2><%= _('Description') %></h2> 16 <h2><%= _('Description') %></h2>
17 <p><%= @block.description %></p> 17 <p><%= @block.description %></p>
  18 + <p><%= @block.new.help if @block.method_defined?(:help) %></p>
18 </div> 19 </div>
19 20
20 </div> 21 </div>