Commit 51672339f91e4869e209587954d495680b1927e5

Authored by AntonioTerceiro
1 parent dfedbe94

ActionItem74: better style for help system



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@607 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
@@ -54,9 +54,9 @@ module ApplicationHelper @@ -54,9 +54,9 @@ module ApplicationHelper
54 # TODO: implement this button, and add style='display: none' to the help 54 # TODO: implement this button, and add style='display: none' to the help
55 # message DIV 55 # message DIV
56 button = link_to_function(_('Help'), "Element.show('help_message')", :class => 'help_button' ) 56 button = link_to_function(_('Help'), "Element.show('help_message')", :class => 'help_button' )
57 - close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('help_message')", :id => 'close_help_button')) 57 + close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('help_message')", :class => 'close_help_button'))
58 58
59 - text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :id => 'help_message', :style => 'display: none;'), :class => 'help_box') 59 + text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :style => 'display: none;'), :class => 'help_box')
60 60
61 unless block.nil? 61 unless block.nil?
62 concat(text, block.binding) 62 concat(text, block.binding)
public/stylesheets/help.css 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +div.help_message {
  2 + z-index: 1000;
  3 + width: 600;
  4 + position: absolute;
  5 + top: 50px;
  6 + left: 50%;
  7 + margin-left: -300px;
  8 + background: yellow;
  9 +}
test/functional/application_controller_test.rb
@@ -36,8 +36,8 @@ class ApplicationControllerTest < Test::Unit::TestCase @@ -36,8 +36,8 @@ class ApplicationControllerTest < Test::Unit::TestCase
36 :attributes => { :class => 'help_box'}, 36 :attributes => { :class => 'help_box'},
37 :descendant => { 37 :descendant => {
38 :tag => 'div', 38 :tag => 'div',
39 - :content => /my_help_message/,  
40 - :attributes => { :class => 'help_message', :style => /display:\s+none/} 39 + :attributes => { :class => 'help_message', :style => /display:\s+none/},
  40 + :descendant => { :tag => 'div', :content => /my_help_message/ }
41 } 41 }
42 }) 42 })
43 end 43 end
@@ -49,8 +49,8 @@ class ApplicationControllerTest < Test::Unit::TestCase @@ -49,8 +49,8 @@ class ApplicationControllerTest < Test::Unit::TestCase
49 :attributes => { :class => 'help_box'}, 49 :attributes => { :class => 'help_box'},
50 :descendant => { 50 :descendant => {
51 :tag => 'div', 51 :tag => 'div',
52 - :content => /my_help_message/,  
53 - :attributes => { :class => 'help_message', :style => /display:\s+none/} 52 + :attributes => { :class => 'help_message', :style => /display:\s+none/},
  53 + :descendant => { :tag => 'div', :content => /my_help_message/ }
54 } 54 }
55 }) 55 })
56 end 56 end