Commit 06e3057bb02e1eb13e11756c9da8a2846aa66e25

Authored by AurelioAHeckert
1 parent 46c033fc

ActionItem625: nice style for zen3 default blocks

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2408 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/my_network_block.rb
... ... @@ -14,10 +14,14 @@ class MyNetworkBlock < Block
14 14 block_title(title) +
15 15 content_tag(
16 16 'ul',
17   - content_tag('li', link_to(n_( 'One article published', '%d articles published', owner.articles.count) % owner.articles.count, owner.public_profile_url.merge(:action => 'sitemap') )) +
18   - content_tag('li', link_to(n__('One friend', '%d friends', owner.friends.count) % owner.friends.count, owner.public_profile_url.merge(:action => 'friends'))) +
19   - content_tag('li', link_to(n__('One community', '%d communities', owner.communities.size) % owner.communities.size, owner.public_profile_url.merge(:action => 'communities'))) +
20   - content_tag('li', link_to(n_('One tag', '%d tags', owner.tags.size) % owner.tags.size, owner.public_profile_url.merge(:action => 'tags')))
  17 + content_tag('li', link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  18 + content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') )) +
  19 + content_tag('li', link_to(n__('One friend', '%s friends', owner.friends.count) %
  20 + content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends'))) +
  21 + content_tag('li', link_to(n__('One community', '%s communities', owner.communities.size) %
  22 + content_tag('b', owner.communities.size), owner.public_profile_url.merge(:action => 'communities'))) +
  23 + content_tag('li', link_to(n_('One tag', '%s tags', owner.tags.size) %
  24 + content_tag('b', owner.tags.size), owner.public_profile_url.merge(:action => 'tags')))
21 25 )
22 26 end
23 27  
... ...
public/designs/themes/zen3/stylesheets/blocks/link-list-block.css
1 1 #content .link-list-block li {
2   - border: 1px solid #CE5C00;
3   - background: #FCAF3E;
  2 + border: 1px solid #A20;
  3 + background: #FCAF3E url("../../images/menu-bg.png");
  4 + white-space: nowrap;
  5 + overflow: hidden;
  6 + width: 95%; /* workarround bug for MSIE */
4 7 }
  8 +#content .link-list-block li:hover {
  9 + background-position: 0% 95%;
  10 +}
  11 +
  12 +#content .link-list-block li a {
  13 + color: #600;
  14 +}
  15 +#content .link-list-block li a:visited {
  16 + color: #900;
  17 +}
  18 +#content .link-list-block li:hover a {
  19 + color: #FC6;
  20 +}
  21 +
... ...
public/stylesheets/blocks/link-list-block.css
... ... @@ -18,7 +18,6 @@
18 18  
19 19 #content .link-list-block {
20 20 padding: 10px 20px 10px 10px;
21   -
22 21 }
23 22  
24 23 .link-list-block ul {
... ... @@ -35,4 +34,5 @@
35 34  
36 35 .link-list-block a {
37 36 text-decoration: none;
  37 + display: block;
38 38 }
... ...
test/unit/my_network_block_test.rb
... ... @@ -25,7 +25,12 @@ class MyNetworkBlockTest < ActiveSupport::TestCase
25 25 owner.stubs(:tags).returns({}) # don't let tags call articles
26 26 mock_articles.stubs(:count).returns(5)
27 27  
28   - assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '5 articles published', :attributes => { :href => /\/profile\/testuser\/sitemap$/ } }
  28 + assert_tag_in_string block.content, :tag => 'li', :descendant => {
  29 + :tag => 'a',
  30 + :descendant => { :tag => 'b', :content => '5' },
  31 + :content => ' articles published',
  32 + :attributes => { :href => /\/profile\/testuser\/sitemap$/ }
  33 + }
29 34 end
30 35  
31 36 should 'count friends' do
... ... @@ -33,7 +38,12 @@ class MyNetworkBlockTest < ActiveSupport::TestCase
33 38 owner.stubs(:friends).returns(mock_friends)
34 39 mock_friends.stubs(:count).returns(8)
35 40  
36   - assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '8 friends', :attributes => { :href => /\profile\/testuser\/friends/ }}
  41 + assert_tag_in_string block.content, :tag => 'li', :descendant => {
  42 + :tag => 'a',
  43 + :descendant => { :tag => 'b', :content => '8' },
  44 + :content => ' friends',
  45 + :attributes => { :href => /\profile\/testuser\/friends/ }
  46 + }
37 47 end
38 48  
39 49 should 'count communities' do
... ... @@ -41,7 +51,12 @@ class MyNetworkBlockTest < ActiveSupport::TestCase
41 51 owner.stubs(:communities).returns(mock_communities)
42 52 mock_communities.stubs(:size).returns(23)
43 53  
44   - assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '23 communities', :attributes => { :href => /\profile\/testuser\/communities/ }}
  54 + assert_tag_in_string block.content, :tag => 'li', :descendant => {
  55 + :tag => 'a',
  56 + :descendant => { :tag => 'b', :content => '23' },
  57 + :content => ' communities',
  58 + :attributes => { :href => /\profile\/testuser\/communities/ }
  59 + }
45 60 end
46 61  
47 62 should 'count tags' do
... ... @@ -49,7 +64,12 @@ class MyNetworkBlockTest < ActiveSupport::TestCase
49 64 owner.stubs(:tags).returns(mock_tags)
50 65 mock_tags.stubs(:size).returns(436)
51 66  
52   - assert_tag_in_string block.content, :tag => 'li', :descendant => { :tag => 'a', :content => '436 tags', :attributes => { :href => /\profile\/testuser\/tags/ }}
  67 + assert_tag_in_string block.content, :tag => 'li', :descendant => {
  68 + :tag => 'a',
  69 + :descendant => { :tag => 'b', :content => '436' },
  70 + :content => ' tags',
  71 + :attributes => { :href => /\profile\/testuser\/tags/ }
  72 + }
53 73 end
54 74  
55 75 should 'display its title' do
... ...