From 72ef7af3f01c4d524d43c8ed893db3e111c9a34f Mon Sep 17 00:00:00 2001 From: AurelioAHeckert Date: Wed, 30 Jan 2008 02:13:57 +0000 Subject: [PATCH] ActionItem152: aleatoriedades... --- app/helpers/application_helper.rb | 16 +++++++++++----- app/helpers/tags_helper.rb | 6 +++++- app/models/tags_block.rb | 9 ++++++++- app/views/cms/select_article_type.rhtml | 8 +++----- app/views/content_viewer/no_home_page.rhtml | 8 +++++++- app/views/features/index.rhtml | 2 +- app/views/layouts/application.rhtml | 5 ++--- app/views/profile_editor/index.rhtml | 2 +- app/views/shared/user_menu.rhtml | 18 +++++++++++++++--- public/designs/icons/default/control-HC.gif | Bin 0 -> 105 bytes public/designs/icons/default/edit-design-HC.gif | Bin 0 -> 112 bytes public/designs/icons/default/help.gif | Bin 0 -> 401 bytes public/designs/icons/default/help.png | Bin 0 -> 916 bytes public/designs/icons/default/style.css | 6 ++++-- public/images/help.png | Bin 916 -> 0 bytes public/stylesheets/button.css | 44 +++++++++++++++++++++++++++----------------- public/stylesheets/common.css | 31 +++++++++++++------------------ public/stylesheets/help.css | 7 ------- public/stylesheets/lightbox.css | 6 +++--- public/stylesheets/login-box.css | 1 - public/stylesheets/menu.css | 5 +++++ 21 files changed, 105 insertions(+), 69 deletions(-) create mode 100644 public/designs/icons/default/control-HC.gif create mode 100644 public/designs/icons/default/edit-design-HC.gif create mode 100644 public/designs/icons/default/help.gif create mode 100644 public/designs/icons/default/help.png delete mode 100644 public/images/help.png diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a5fec11..6796bad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,7 +50,9 @@ module ApplicationHelper # textile, into HTML). It defaults to :html. # # TODO: implement correcly the 'Help' button click - def help(content = nil, type = :html, &block) + def help(content = nil, link_name = nil, options = {}, &block) + + link_name ||= _('Help') @help_message_id ||= 1 help_id = "help_message_#{@help_message_id}" @@ -60,13 +62,16 @@ module ApplicationHelper content = capture(&block) end - if type == :textile + if options[:type] == :textile content = RedCloth.new(content).to_html end + + options[:class] = '' if ! options[:class] + options[:class] += ' button icon-help' # with-text # TODO: implement this button, and add style='display: none' to the help # message DIV - button = link_to_function(content_tag('span', _('Help')), "Element.show('#{help_id}')", :class => 'help_button' ) + button = link_to_function(content_tag('span', link_name), "Element.show('#{help_id}')", options ) close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('#{help_id}')", :class => 'close_help_button')) 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') @@ -80,8 +85,9 @@ module ApplicationHelper # alias for help(content, :textile). You can pass a block in the # same way you would do if you called help directly. - def help_textile(content = nil, &block) - help(content, :textile, &block) + def help_textile(content = nil, link_name = nil, options = {}, &block) + options[:type] = :textile + help(content, link_name, options, &block) end # TODO: do something more useful here diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index 2829131..23a038a 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -27,8 +27,12 @@ module TagsHelper # courtesy of Aurelio: http://www.colivre.coop.br/Aurium/Nuvem # (pt_BR only). def tag_cloud(tags, tagname_option, url, options = {}) + - return _('No tags yet.') if tags.empty? + return _('No tags yet.') + '
' + + '' + + _('What are tags?') + '' if tags.empty? max_size = options[:max_size] || Cloud::MAX_SIZE min_size = options[:min_size] || Cloud::MIN_SIZE diff --git a/app/models/tags_block.rb b/app/models/tags_block.rb index f5ec354..036fc85 100644 --- a/app/models/tags_block.rb +++ b/app/models/tags_block.rb @@ -1,6 +1,7 @@ class TagsBlock < Block include TagsHelper + include ApplicationHelper def self.description _('List count of contents by tag') @@ -8,7 +9,13 @@ class TagsBlock < Block def content content_tag('h3', _('Tags'), :class => 'block-title') + - tag_cloud(owner.tags, :id, owner.generate_url(:controller => 'profile', :action => 'tag') + '/', :max_size => 20, :min_size => 10) + help_textile( + _('The tag is created when you add some one to your article. + Try to add some tags to some articles and see your tag cloud to grow.'), + _('How tags works here?') ) + + tag_cloud( owner.tags, :id, + owner.generate_url(:controller => 'profile', :action => 'tag') + '/', + :max_size => 20, :min_size => 10 ) end end diff --git a/app/views/cms/select_article_type.rhtml b/app/views/cms/select_article_type.rhtml index a641680..71931ab 100644 --- a/app/views/cms/select_article_type.rhtml +++ b/app/views/cms/select_article_type.rhtml @@ -1,12 +1,10 @@ -

- <%= _('Choose the type of article:') %> -

+

<%= _('Choose the type of article:') %>

-