From 7b1a306f6a80bf2cb2152dd2a4bed7204560a962 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 16 Dec 2014 11:24:37 -0300 Subject: [PATCH] Display new help view when clicked at block help --- app/helpers/boxes_helper.rb | 7 +++++-- app/views/box_organizer/show_block_type_info.html.erb | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index cb19981..b85a675 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -215,8 +215,11 @@ module BoxesHelper buttons << icon_button(:clone, _('Clone'), { :action => 'clone_block', :id => block.id }, { :method => 'post' }) end - if block.respond_to?(:help) - 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}") + unless block.kind_of?(MainBlock) + buttons << link_to(content_tag('span', _('Help on this block')), + {:action => 'show_block_type_info', :type => block.class.name}, + :class => "button icon-button icon-help colorbox", + :title => _('Help on this block')) end if block.embedable? diff --git a/app/views/box_organizer/show_block_type_info.html.erb b/app/views/box_organizer/show_block_type_info.html.erb index ef194a3..13fc233 100644 --- a/app/views/box_organizer/show_block_type_info.html.erb +++ b/app/views/box_organizer/show_block_type_info.html.erb @@ -15,6 +15,7 @@

<%= _('Description') %>

<%= @block.description %>

+

<%= @block.new.help if @block.method_defined?(:help) %>

-- libgit2 0.21.2