Commit 72ef7af3f01c4d524d43c8ed893db3e111c9a34f

Authored by AurelioAHeckert
1 parent 7712c736

ActionItem152: aleatoriedades...

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1282 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -50,7 +50,9 @@ module ApplicationHelper
50 50 # textile, into HTML). It defaults to <tt>:html</tt>.
51 51 #
52 52 # TODO: implement correcly the 'Help' button click
53   - def help(content = nil, type = :html, &block)
  53 + def help(content = nil, link_name = nil, options = {}, &block)
  54 +
  55 + link_name ||= _('Help')
54 56  
55 57 @help_message_id ||= 1
56 58 help_id = "help_message_#{@help_message_id}"
... ... @@ -60,13 +62,16 @@ module ApplicationHelper
60 62 content = capture(&block)
61 63 end
62 64  
63   - if type == :textile
  65 + if options[:type] == :textile
64 66 content = RedCloth.new(content).to_html
65 67 end
  68 +
  69 + options[:class] = '' if ! options[:class]
  70 + options[:class] += ' button icon-help' # with-text
66 71  
67 72 # TODO: implement this button, and add style='display: none' to the help
68 73 # message DIV
69   - button = link_to_function(content_tag('span', _('Help')), "Element.show('#{help_id}')", :class => 'help_button' )
  74 + button = link_to_function(content_tag('span', link_name), "Element.show('#{help_id}')", options )
70 75 close_button = content_tag("div", link_to_function(_("Close"), "Element.hide('#{help_id}')", :class => 'close_help_button'))
71 76  
72 77 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
80 85  
81 86 # alias for <tt>help(content, :textile)</tt>. You can pass a block in the
82 87 # same way you would do if you called <tt>help</tt> directly.
83   - def help_textile(content = nil, &block)
84   - help(content, :textile, &block)
  88 + def help_textile(content = nil, link_name = nil, options = {}, &block)
  89 + options[:type] = :textile
  90 + help(content, link_name, options, &block)
85 91 end
86 92  
87 93 # TODO: do something more useful here
... ...
app/helpers/tags_helper.rb
... ... @@ -27,8 +27,12 @@ module TagsHelper
27 27 # courtesy of Aurelio: http://www.colivre.coop.br/Aurium/Nuvem
28 28 # (pt_BR only).
29 29 def tag_cloud(tags, tagname_option, url, options = {})
  30 +
30 31  
31   - return _('No tags yet.') if tags.empty?
  32 + return _('No tags yet.') + '<br/>' +
  33 + '<a href="' + _('http://en.wikipedia.org/wiki/Tag_%28metadata%29') +
  34 + '" class="button with-text icon-help" target="wptags"><span>' +
  35 + _('What are tags?') + '</span></a>' if tags.empty?
32 36  
33 37 max_size = options[:max_size] || Cloud::MAX_SIZE
34 38 min_size = options[:min_size] || Cloud::MIN_SIZE
... ...
app/models/tags_block.rb
1 1 class TagsBlock < Block
2 2  
3 3 include TagsHelper
  4 + include ApplicationHelper
4 5  
5 6 def self.description
6 7 _('List count of contents by tag')
... ... @@ -8,7 +9,13 @@ class TagsBlock &lt; Block
8 9  
9 10 def content
10 11 content_tag('h3', _('Tags'), :class => 'block-title') +
11   - tag_cloud(owner.tags, :id, owner.generate_url(:controller => 'profile', :action => 'tag') + '/', :max_size => 20, :min_size => 10)
  12 + help_textile(
  13 + _('The tag is created when you add some one to your article.
  14 + Try to add some tags to some articles and see your tag cloud to grow.'),
  15 + _('How tags works here?') ) +
  16 + tag_cloud( owner.tags, :id,
  17 + owner.generate_url(:controller => 'profile', :action => 'tag') + '/',
  18 + :max_size => 20, :min_size => 10 )
12 19 end
13 20  
14 21 end
... ...
app/views/cms/select_article_type.rhtml
1   -<p>
2   - <%= _('Choose the type of article:') %>
3   -</p>
  1 +<h2> <%= _('Choose the type of article:') %> </h2>
4 2  
5   -<ul>
  3 +<ul id="article_types">
6 4 <% for type in @article_types %>
7 5 <li>
8 6 <%= link_to type[:short_description], :action => 'new', :type => type[:name] %>
9   - <p><%= type[:description] %></p>
  7 + <br/> <%= type[:description] %>
10 8 </li>
11 9 <% end %>
12 10 </ul>
... ...
app/views/content_viewer/no_home_page.rhtml
1   -<h2><%= _("Missing home page") %></h2>
  1 +<h1 class="block-title"><%= _("Missing home page") %></h1>
2 2  
3 3 <p>
4 4 <%= _('%s did not choose an article for homepage yet.') % profile.name %>
5 5 </p>
  6 +
  7 +<% if user == profile %>
  8 +<p>
  9 +<%= link_to _('Click hire to set your homepage now!'), :controller => 'cms' %>
  10 +</p>
  11 +<% end %>
... ...
app/views/features/index.rhtml
... ... @@ -4,4 +4,4 @@
4 4  
5 5 <%= help_textile _('Here you can enable or disable several features of your environment. Each feature represents some funcionality that your environment can use if you enable it.
6 6  
7   -Check all the features you want to enable for your environment, uncheck all the ones you don\t want, and use the \'Save changes\' button to confirm your changes.') %>
  7 +Check all the features you want to enable for your environment, uncheck all the ones you don\'t want, and use the *"Save changes" button* to confirm your changes.'), _('Help'), :class => 'with-text' %>
... ...
app/views/layouts/application.rhtml
... ... @@ -2,10 +2,9 @@
2 2 <head>
3 3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
4 4 <title>
  5 + <%= @environment.name() %>
5 6 <%- if @category -%>
6   - Noosfero &rarr; <%= @category.full_name -%>
7   - <%- else -%>
8   - Noosfero
  7 + &rarr; <%= @category.full_name -%>
9 8 <%- end -%>
10 9 </title>
11 10 <meta name="description" content="FIXME: Descriptions of Noosfero" />
... ...
app/views/profile_editor/index.rhtml
1   -<h1><%= _('My profile') %></h1>
  1 +<h1 class="block-title"><%= _('My profile') %></h1>
2 2  
3 3 <%= link_to (@profile.image ? image_tag( @profile.image.public_filename) : _('Put image')), :action => 'change_image' %>
4 4  
... ...
app/views/shared/user_menu.rhtml
... ... @@ -10,20 +10,32 @@
10 10 %>
11 11 <div id="user_menu_ul">
12 12 <ul>
  13 +
13 14 <li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li>
  15 +
14 16 <li><%= link_to_myprofile( '<span class="icon-menu-ctrl-panel"></span>'+ _('control panel'),
15 17 {}, nil, :id => 'link_edit_profile' ) %></li>
16   - <li><%= link_to( '<span class="icon-menu-"></span>'+_('Edit Profile'),
  18 +
  19 + <li><%= link_to( '<span class="icon-menu-edit"></span>'+_('Edit Profile'),
17 20 :controller => 'profile_editor', :profile => user.identifier, :action => 'edit' ) %></li>
18   - <li><%= link_to( '<span class="icon-menu-"></span>'+_('Consumed Products'),
  21 +
  22 + <li><%= link_to( '<span class="icon-menu-product"></span>'+_('Consumed Products'),
19 23 :profile => user.identifier, :controller => 'consumed_products' ) %></li>
20 24 <%=
21 25 '<li>'+ link_to( '<span class="icon-menu-"></span>'+ _('Admin'),
22 26 { :controller => 'admin_panel' }, :id => 'link_admin_panel' ) +
23 27 '</li>' if user.is_admin?
24 28 %>
  29 +
  30 + <li><%= link_to( '<span class="icon-menu-ed-design"></span>'+_('Edit Visual Design'),
  31 + :controller => 'profile_design', :profile => user.identifier ) %></li>
  32 +
  33 + <li><%= link_to( '<span class="icon-menu-"></span>'+_('Manage Content'),
  34 + :controller => 'cms', :profile => user.identifier) %></li>
  35 +
25 36 <li><%= lightbox_link_to( '<span class="icon-menu-logout"></span>'+ _('Logout'),
26   - { :controller => 'account', :action => 'logout_popup'}, :id => 'link_logout' ) %></li>
  37 + { :controller => 'account', :action => 'logout_popup'}, :id => 'link_logout' ) %></li>
  38 +
27 39 </ul>
28 40 </div><!-- id="user_menu_ul" -->
29 41  
... ...
public/designs/icons/default/control-HC.gif 0 → 100644

105 Bytes

public/designs/icons/default/edit-design-HC.gif 0 → 100644

112 Bytes

public/designs/icons/default/help.gif 0 → 100644

401 Bytes

public/designs/icons/default/help.png 0 → 100644

916 Bytes

public/designs/icons/default/style.css
... ... @@ -19,14 +19,16 @@
19 19 .icon-search { background-image: url(gnome-search.png); }
20 20 .icon-ok { background-image: url(gtk-ok.png); }
21 21 .icon-login { background-image: url(key-HC.gif); }
  22 +.icon-help { background-image: url(help.gif); }
22 23 .icon-menu- { background-image: url(menu-without-ico-HC.gif) }
23 24 .icon-menu-blog { background-image: url(blog-HC.gif); }
24 25 .icon-menu-album { background-image: url(album-HC.gif); }
25 26 .icon-menu-product { background-image: url(product-HC.gif); }
26 27 .icon-menu-enterprise { background-image: url(enterprise-HC.gif); }
27 28 .icon-menu-community { background-image: url(community-HC.gif); }
28   -.icon-menu-ctrl-panel { background-image: url(edit-HC.gif); }
  29 +.icon-menu-edit { background-image: url(edit-HC.gif); }
  30 +.icon-menu-ctrl-panel { background-image: url(control-HC.gif); }
29 31 .icon-menu-login { background-image: url(enter-HC.gif); }
30 32 .icon-menu-logout { background-image: url(exit-HC.gif); }
31 33 .icon-menu-search { background-image: url(search-HC.gif); }
32   -
  34 +.icon-menu-ed-design { background-image: url(edit-design-HC.gif); }
... ...
public/images/help.png

916 Bytes

public/stylesheets/button.css
... ... @@ -2,20 +2,23 @@
2 2 margin-top: 1em;
3 3 }
4 4  
5   -.button {
6   - border: none;
  5 +a.button,
  6 +a.button:visited,
  7 +input.button {
7 8 margin-left: 5px;
8   - background-color: #EEE;
9 9 background-repeat: no-repeat;
10   - background-position: 2px 50%;
11   - padding-left: 25px;
12   - padding-right: 2px;
  10 + background-position: 50% 50%;
  11 + padding: 1px 0px 1px 20px;
13 12 height: 24px;
14 13 line-height: 22px;
15 14 font-size: 12px;
  15 + color: black;
  16 + text-decoration: none;
  17 + border: 1px solid #DDD;
16 18 }
17 19 input.button {
18 20 float: none;
  21 + background-position: 2px 50%;
19 22 }
20 23  
21 24 .button-bar .button {
... ... @@ -29,17 +32,6 @@ input.button {
29 32 color: #000;
30 33 }
31 34  
32   -.button, .button:visited {
33   - color: black;
34   - text-decoration: none;
35   - border: 1px solid #AAA;
36   -}
37   -
38   -.button:hover {
39   - border: 1px solid #777;
40   - background-color: #DDD;
41   -}
42   -
43 35 .button span {
44 36 display: none;
45 37 }
... ... @@ -48,6 +40,24 @@ input.button {
48 40 padding-right: 4px;
49 41 }
50 42  
  43 +a.button.with-text,
  44 +a.button.with-text:visited,
  45 +input.button.with-text {
  46 + background-color: #EEE;
  47 + padding: 1px 2px 1px 25px;
  48 + background-position: 2px 50%;
  49 + border: 1px solid #AAA;
  50 +}
  51 +
  52 +a.button:hover,
  53 +input.button:hover,
  54 +a.button.with-text:hover,
  55 +input.button.with-text:hover {
  56 + border: 1px solid #777;
  57 + background-color: #DDD;
  58 + color: #000;
  59 +}
  60 +
51 61 .icon-button {
52 62 border: none;
53 63 }
... ...
public/stylesheets/common.css
... ... @@ -46,7 +46,7 @@ body.category4 #wrap { background-image: url(&quot;../images/bg-top-vermelho.png&quot;); }
46 46 }
47 47  
48 48 #header {
49   - height: 30px;
  49 + height: 50px;
50 50 }
51 51  
52 52 #design_boxes {
... ... @@ -77,11 +77,14 @@ body.category4 #wrap {
77 77 border-color: #B80000;
78 78 }
79 79  
80   -a img {
81   - border: 1px solid transparent;
  80 +a {
  81 + color: #05B;
82 82 }
83   -a:hover img {
84   - border: 1px solid gray;
  83 +a:visited {
  84 + color: #68C;
  85 +}
  86 +a:hover a:active {
  87 + color: #08F;
85 88 }
86 89  
87 90 #environment_identification {
... ... @@ -335,20 +338,12 @@ div#notice {
335 338 #content h1 {
336 339 text-align: center;
337 340 }
338   -
339   -#login-box a,
340   -#content a {
341   - color: #05B;
  341 +#content h1, #content h2, #content h3,
  342 +#content h4, #content h5, #content h6 {
  343 + margin: 10px 0px;
342 344 }
343   -#login-box a:visited,
344   -#content a:visited {
345   - color: #68C;
346   -}
347   -#login-box a:hover,
348   -#login-box a:active,
349   -#content a:hover,
350   -#content a:active {
351   - color: #08F;
  345 +#content .block-title {
  346 + margin: 0px 0px 10px 0px;
352 347 }
353 348  
354 349 /* Category */
... ...
public/stylesheets/help.css
... ... @@ -14,10 +14,3 @@ div.help_message {
14 14 overflow: auto;
15 15 }
16 16  
17   -a.help_button:before {
18   - content: url(../images/help.png)
19   -}
20   -
21   -a.help_button:hover {
22   - background: #ffa;
23   -}
... ...
public/stylesheets/lightbox.css
... ... @@ -35,9 +35,9 @@ Modified : February 1, 2006
35 35 height:100%;
36 36 z-index:5000;
37 37 background-color:#000;
38   - -moz-opacity: 0.8;
39   - opacity:.80;
40   - filter: alpha(opacity=80);
  38 + -moz-opacity: 0.5;
  39 + opacity:.50;
  40 + filter: alpha(opacity=50);
41 41 }
42 42 #overlay[id]{
43 43 position:fixed;
... ...
public/stylesheets/login-box.css
... ... @@ -17,7 +17,6 @@
17 17 }
18 18  
19 19 #login-box h2 {
20   - color: #888;
21 20 font-size: 18px;
22 21 text-align: center;
23 22 margin: 0px;
... ...
public/stylesheets/menu.css
... ... @@ -190,6 +190,7 @@ body.category4 #assets_menu_list { background-image: url(/images/top-bar/assets-
190 190 }
191 191  
192 192 #user_box a,
  193 +#assets_menu a,
193 194 .top_extra_menu a {
194 195 font-size: 12px;
195 196 font-weight: bold;
... ... @@ -304,6 +305,10 @@ body.category4 .top_extra_menu a:hover { background: #CC0000; color: #FFF }
304 305 background: url(/images/top-bar/assets-menu-bg-azul.gif) 0% 100%;
305 306 border-right: 1px solid #FFF;
306 307 }
  308 +body.category1 #user_menu_ul { background-image: url(/images/top-bar/assets-menu-bg-laranja.gif) }
  309 +body.category2 #user_menu_ul { background-image: url(/images/top-bar/assets-menu-bg-verde.gif) }
  310 +body.category3 #user_menu_ul { background-image: url(/images/top-bar/assets-menu-bg-lilas.gif) }
  311 +body.category4 #user_menu_ul { background-image: url(/images/top-bar/assets-menu-bg-vermelho.gif) }
307 312  
308 313 #user_menu ul {
309 314 width: 150px;
... ...