From b40cea44a70c3c9703e548d4362baff1c38e6e63 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Fri, 15 Jan 2010 10:55:15 -0300 Subject: [PATCH] Thickbox not looping when trying to login while viewing an image --- app/helpers/boxes_helper.rb | 2 +- app/helpers/thickbox_helper.rb | 8 ++++---- app/views/layouts/application-ng.rhtml | 2 +- app/views/shared/user_menu.rhtml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index 589217b..671c97b 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -206,7 +206,7 @@ module BoxesHelper 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}") + 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}") end content_tag('div', buttons.join("\n") + tag('br', :style => 'clear: left'), :class => 'button-bar') diff --git a/app/helpers/thickbox_helper.rb b/app/helpers/thickbox_helper.rb index c00df57..376dd4f 100644 --- a/app/helpers/thickbox_helper.rb +++ b/app/helpers/thickbox_helper.rb @@ -1,9 +1,9 @@ module ThickboxHelper - def thickbox_inline_popup_link(title, id, options = {}) - link_to(title, "#TB_inline?height=300&width=500&inlineId=#{id}&modal=true", {:class => 'thickbox'}.merge(options)) + def thickbox_inline_popup_link(title, url, id, options = {}) + link_to(title, url_for(url) + "#TB_inline?height=300&width=500&inlineId=#{id}&modal=true", {:class => 'thickbox'}.merge(options)) end - def thickbox_inline_popup_icon(type, title, id, options = {}) - icon_button(type, title, "#TB_inline?height=300&width=500&inlineId=#{id}&modal=true", {:class => "thickbox"}.merge(options)) + def thickbox_inline_popup_icon(type, title, url, id, options = {}) + icon_button(type, title, url_for(url) + "#TB_inline?height=300&width=500&inlineId=#{id}&modal=true", {:class => "thickbox"}.merge(options)) end def thickbox_close_button(title) button_to_function(:close, title, 'tb_remove();') diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index e998933..f72dedc 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -67,7 +67,7 @@ <% end %> <%= link_to('' + _('Logout') + '', { :controller => 'account', :action => 'logout'} , :id => "logout", :title => _("Leave the system")) %> <% else %> - <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %> + <%= _('%s or %s') % [thickbox_inline_popup_link('' + _('Login') + '', login_url, 'inlineLoginBox', :id => 'link_login', :help => _('Click here to enter your username and password and be recognized by the system.')), link_to('' + _('Register') + '', :controller => 'account', :action => 'signup') ] %>