Commit 60c3a8e0f53b1aa99ecaa50676452a2e452da26c
1 parent
51672339
Exists in
master
and in
29 other branches
ActionItem74: improving help system
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@608 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
14 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -42,6 +42,9 @@ module ApplicationHelper |
42 | 42 | # TODO: implement correcly the 'Help' button click |
43 | 43 | def help(content = nil, type = :html, &block) |
44 | 44 | |
45 | + @help_message_id ||= 1 | |
46 | + help_id = "help_message_#{@help_message_id}" | |
47 | + | |
45 | 48 | if content.nil? |
46 | 49 | return '' if block.nil? |
47 | 50 | content = capture(&block) |
... | ... | @@ -53,10 +56,10 @@ module ApplicationHelper |
53 | 56 | |
54 | 57 | # TODO: implement this button, and add style='display: none' to the help |
55 | 58 | # message DIV |
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')", :class => 'close_help_button')) | |
59 | + button = link_to_function(content_tag('span', _('Help')), "Element.show('#{help_id}')", :class => 'help_button' ) | |
60 | + close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('#{help_id}')", :class => 'close_help_button')) | |
58 | 61 | |
59 | - text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :style => 'display: none;'), :class => 'help_box') | |
62 | + text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :id => help_id, :style => 'display: none;'), :class => 'help_box') | |
60 | 63 | |
61 | 64 | unless block.nil? |
62 | 65 | concat(text, block.binding) | ... | ... |
916 Bytes
public/stylesheets/help.css