diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 726db32..b737c23 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,9 +54,9 @@ module ApplicationHelper # TODO: implement this button, and add style='display: none' to the help # message DIV button = link_to_function(_('Help'), "Element.show('help_message')", :class => 'help_button' ) - close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('help_message')", :id => 'close_help_button')) + close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('help_message')", :class => 'close_help_button')) - text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :id => 'help_message', :style => 'display: none;'), :class => 'help_box') + text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :style => 'display: none;'), :class => 'help_box') unless block.nil? concat(text, block.binding) diff --git a/public/stylesheets/help.css b/public/stylesheets/help.css new file mode 100644 index 0000000..a238a30 --- /dev/null +++ b/public/stylesheets/help.css @@ -0,0 +1,9 @@ +div.help_message { + z-index: 1000; + width: 600; + position: absolute; + top: 50px; + left: 50%; + margin-left: -300px; + background: yellow; +} diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 1a646b8..cd020ec 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -36,8 +36,8 @@ class ApplicationControllerTest < Test::Unit::TestCase :attributes => { :class => 'help_box'}, :descendant => { :tag => 'div', - :content => /my_help_message/, - :attributes => { :class => 'help_message', :style => /display:\s+none/} + :attributes => { :class => 'help_message', :style => /display:\s+none/}, + :descendant => { :tag => 'div', :content => /my_help_message/ } } }) end @@ -49,8 +49,8 @@ class ApplicationControllerTest < Test::Unit::TestCase :attributes => { :class => 'help_box'}, :descendant => { :tag => 'div', - :content => /my_help_message/, - :attributes => { :class => 'help_message', :style => /display:\s+none/} + :attributes => { :class => 'help_message', :style => /display:\s+none/}, + :descendant => { :tag => 'div', :content => /my_help_message/ } } }) end -- libgit2 0.21.2