Commit b3bb617789de1c6a58f30594841ac152f1e1df13
1 parent
0b8734e8
Exists in
master
and in
29 other branches
ActionItem183: better tags and profile info
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1503 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
18 changed files
with
110 additions
and
31 deletions
Show diff stats
app/helpers/application_helper.rb
| ... | ... | @@ -332,7 +332,7 @@ module ApplicationHelper |
| 332 | 332 | if File.exists?(File.join(RAILS_ROOT, 'public', filename)) |
| 333 | 333 | "@import url(#{filename});\n" |
| 334 | 334 | else |
| 335 | - '' | |
| 335 | + "/* Not included: url(#{filename}) */\n" | |
| 336 | 336 | end |
| 337 | 337 | end.join(), |
| 338 | 338 | { "type" => "text/css" }.merge(options) |
| ... | ... | @@ -342,7 +342,7 @@ module ApplicationHelper |
| 342 | 342 | def filename_for_stylesheet(name, in_theme) |
| 343 | 343 | result = '' |
| 344 | 344 | if in_theme |
| 345 | - result << '/designs/templates/' + current_theme | |
| 345 | + result << '/designs/themes/' + current_theme | |
| 346 | 346 | end |
| 347 | 347 | result << '/stylesheets/' << name << '.css' |
| 348 | 348 | end | ... | ... |
app/helpers/tags_helper.rb
| ... | ... | @@ -40,12 +40,17 @@ module TagsHelper |
| 40 | 40 | |
| 41 | 41 | delta = max_size - min_size |
| 42 | 42 | max = tags.values.max.to_f |
| 43 | + min = tags.values.min.to_f | |
| 43 | 44 | |
| 44 | 45 | tags.map do |tag,count| |
| 45 | - v = count.to_f / max | |
| 46 | + if ( max == min ) | |
| 47 | + v = 0.5 | |
| 48 | + else | |
| 49 | + v = (count.to_f - min) / (max - min) | |
| 50 | + end | |
| 46 | 51 | style = ""+ |
| 47 | 52 | "font-size: #{ (v * delta).round + min_size }px;"+ |
| 48 | - "top: #{ -4 - (v * 4).round }px;" | |
| 53 | + "top: #{ -(delta/2) - (v * (delta/2)).round }px;" | |
| 49 | 54 | destination = url.kind_of?(Hash) ? url_for(url.merge(tagname_option => tag)) : (url.to_s + tag) |
| 50 | 55 | |
| 51 | 56 | display_count = options[:show_count] ? "<small><sup>(#{count})</sup></small>" : "" | ... | ... |
app/models/profile_info_block.rb
| ... | ... | @@ -4,6 +4,10 @@ class ProfileInfoBlock < Block |
| 4 | 4 | _('Profile information block') |
| 5 | 5 | end |
| 6 | 6 | |
| 7 | + def help | |
| 8 | + _('Basic information about <i>%{user}</i>. Here you see how much time <i>%{user}</i> is part of the <i>%{env}</i> enviroment, and useful links.') % { :user => self.owner.name(), :env => self.owner.environment.name() } | |
| 9 | + end | |
| 10 | + | |
| 7 | 11 | def content |
| 8 | 12 | block = self |
| 9 | 13 | lambda do | ... | ... |
app/models/profile_list_block.rb
| ... | ... | @@ -66,7 +66,7 @@ class ProfileListBlock < Block |
| 66 | 66 | lambda do |
| 67 | 67 | list = profiles.map {|item| content_tag( 'li', profile_image_link(item) ) }.join("\n ") |
| 68 | 68 | if list.empty? |
| 69 | - list = '<i>'+ _('None') +'</i>' | |
| 69 | + list = '<div class="common-profile-list-block-none">'+ _('None') +'</div>' | |
| 70 | 70 | else |
| 71 | 71 | list = content_tag( 'ul', nl +' '+ list + nl ) |
| 72 | 72 | end | ... | ... |
app/models/tags_block.rb
| ... | ... | @@ -18,7 +18,7 @@ class TagsBlock < Block |
| 18 | 18 | "\n<div class='tag_cloud'>\n"+ |
| 19 | 19 | tag_cloud( owner.tags, :id, |
| 20 | 20 | owner.generate_url(:controller => 'profile', :action => 'tag'), |
| 21 | - :max_size => 18, :min_size => 9 ) + | |
| 21 | + :max_size => 16, :min_size => 9 ) + | |
| 22 | 22 | "\n</div><!-- end class='tag_cloud' -->\n"; |
| 23 | 23 | end |
| 24 | 24 | ... | ... |
app/views/blocks/profile_info.rhtml
| 1 | 1 | <h2><%= block.owner.name %></h2> |
| 2 | 2 | |
| 3 | -<%= profile_image(block.owner) %> | |
| 3 | +<div class="profile-info-picture"><%= profile_image(block.owner) %></div> | |
| 4 | 4 | |
| 5 | -<ul> | |
| 6 | - <li><%= _('Since %d') % block.owner.created_at.year %></li> | |
| 5 | +<ul class="profile-info-data"> | |
| 6 | + <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> | |
| 7 | 7 | <li><%= link_to _('Homepage'), block.owner.url %></li> |
| 8 | 8 | <li><%= link_to _('View profile'), block.owner.public_profile_url %></li> |
| 9 | 9 | </ul> |
| 10 | 10 | |
| 11 | -<div class='profile-info-options'> | |
| 11 | +<div class="profile-info-options"> | |
| 12 | 12 | <%= render :file => 'blocks/profile_info_actions/' + block.owner.class.name.underscore %> |
| 13 | 13 | </div> |
| 14 | 14 | ... | ... |
app/views/blocks/profile_info_actions/community.rhtml
| 1 | 1 | <ul> |
| 2 | 2 | <% if logged_in? %> |
| 3 | - <li><%= link_to _('Join this community'), :profile => user.identifier, :controller => 'memberships', :action => 'join', :id => profile.id %></li> | |
| 3 | + <li><%= link_to content_tag('span', _('Join this community')), { :profile => user.identifier, :controller => 'memberships', :action => 'join', :id => profile.id }, :class => 'button with-text icon-add' %></li> | |
| 4 | 4 | <% end %> |
| 5 | 5 | </ul> | ... | ... |
app/views/blocks/profile_info_actions/person.rhtml
| 1 | 1 | <ul> |
| 2 | 2 | <%if logged_in? && (user != profile) && (! user.friends.include?(profile)) %> |
| 3 | - <li><%= link_to _('Add friend'), :profile => user.identifier, :controller => 'friends', :action => 'add', :id => profile.id %></li> | |
| 3 | + <li><%= link_to content_tag('span', _('Add friend')), { :profile => user.identifier, :controller => 'friends', :action => 'add', :id => profile.id }, :class => 'button with-text icon-add' %></li> | |
| 4 | 4 | <% end %> |
| 5 | 5 | </ul> | ... | ... |
1.16 KB
919 Bytes
905 Bytes
1.18 KB
public/designs/themes/default/stylesheets/blocks/profile-info-block.css
0 → 100644
| ... | ... | @@ -0,0 +1,30 @@ |
| 1 | +.profile-info-block h2 { | |
| 2 | + text-align: center; | |
| 3 | +} | |
| 4 | + | |
| 5 | +.profile-info-picture { | |
| 6 | + border: 2px solid #204A87; | |
| 7 | + padding: 1px; | |
| 8 | + background: #FFF; | |
| 9 | + margin-right: 40px; | |
| 10 | +} | |
| 11 | +.msie6 .profile-info-picture { | |
| 12 | + margin-right: 20px; | |
| 13 | +} | |
| 14 | + | |
| 15 | +.profile-info-data { | |
| 16 | + width: 140px; | |
| 17 | + font-size: 10px; | |
| 18 | + text-align: right; | |
| 19 | + position: relative; | |
| 20 | + top: 6px; | |
| 21 | +} | |
| 22 | + | |
| 23 | +.profile-info-options { | |
| 24 | + clear: both; | |
| 25 | +} | |
| 26 | + | |
| 27 | +.profile-info-options { | |
| 28 | + text-align: center; | |
| 29 | +} | |
| 30 | + | ... | ... |
public/designs/themes/default/stylesheets/blocks/tags-block.css
0 → 100644
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +.tags-block { | |
| 2 | +} | |
| 3 | +.box-2 .tags-block { | |
| 4 | + text-align: right; | |
| 5 | +} | |
| 6 | + | |
| 7 | +#content .tags-block .block-title { | |
| 8 | + margin-bottom: 0px; | |
| 9 | + background: url(../../images/bg-tags-top.png) 0% 0%; | |
| 10 | + padding: 3px 0px 0px 20px; | |
| 11 | +} | |
| 12 | + | |
| 13 | +.tags-block .tag_cloud { | |
| 14 | + background: url(../../images/bg-tags.png) 0% 100%; | |
| 15 | + padding: 0px 0px 5px 5px; | |
| 16 | +} | |
| 17 | + | |
| 18 | +#content .box-2 .tags-block .block-title { | |
| 19 | + background: url(../../images/bg-tags-top-2.png) no-repeat 100% 0%; | |
| 20 | + padding: 3px 20px 0px 0px; | |
| 21 | +} | |
| 22 | +.box-2 .tags-block .tag_cloud { | |
| 23 | + background: url(../../images/bg-tags-2.png) no-repeat 100% 100%; | |
| 24 | + padding: 0px 5px 5px 0px; | |
| 25 | +} | |
| 26 | + | |
| 27 | +.tags-block .tag_cloud a { | |
| 28 | + text-decoration: none; | |
| 29 | + padding: 0px 4px; | |
| 30 | +} | |
| 31 | + | |
| 32 | +.tags-block .tag_cloud a:hover { | |
| 33 | + color: red; | |
| 34 | +} | ... | ... |
public/stylesheets/blocks/profile-info-block.css
| 1 | -div.profile-info-block img { | |
| 1 | + | |
| 2 | +.profile-info-picture { | |
| 2 | 3 | float: right; |
| 3 | - margin-left: 1em; | |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -div.profile-info-block { | |
| 6 | +.profile-info-block { | |
| 7 | 7 | padding-left: 1em; |
| 8 | 8 | padding-right: 1em; |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -div.profile-info-block ul { | |
| 11 | +.profile-info-block ul { | |
| 12 | 12 | padding: 0px; |
| 13 | + margin: 0px; | |
| 13 | 14 | } |
| 14 | 15 | |
| 15 | -div.profile-info-block li { | |
| 16 | +.profile-info-block li { | |
| 16 | 17 | list-style: none; |
| 17 | - border-bottom: 1px solid #d0d0d0; | |
| 18 | - background: #f0f0f0; | |
| 18 | + margin: 0px; | |
| 19 | 19 | padding: 2px; |
| 20 | 20 | } | ... | ... |
public/stylesheets/blocks/profile-list-block.css
| ... | ... | @@ -59,6 +59,20 @@ |
| 59 | 59 | .communities-block .block-footer-content { |
| 60 | 60 | text-align: center; |
| 61 | 61 | font-size: 80%; |
| 62 | - padding: 10px 0px 0px 0px; | |
| 62 | + padding: 5px 0px 0px 0px; | |
| 63 | +} | |
| 64 | +.msie .enterprises-block .block-footer-content, | |
| 65 | +.msie .communities-block .block-footer-content { | |
| 66 | + padding: 0px; | |
| 67 | + margin-top: -5px; | |
| 68 | +} | |
| 69 | + | |
| 70 | +.common-profile-list-block-none { | |
| 71 | + font-style: italic; | |
| 72 | + margin-bottom: -10px; | |
| 73 | +} | |
| 74 | +.msie .common-profile-list-block-none { | |
| 75 | + margin-bottom: 0px; | |
| 76 | + padding-bottom: 10px; | |
| 63 | 77 | } |
| 64 | 78 | ... | ... |
public/stylesheets/blocks/tags-block.css
| 1 | 1 | .tags-block { |
| 2 | 2 | } |
| 3 | 3 | |
| 4 | -.tags-block .help_tags { | |
| 5 | - position: absolute; | |
| 6 | - top: 10px; | |
| 7 | - right: 2px; | |
| 8 | -} | |
| 9 | - | |
| 10 | -.tag_cloud a { | |
| 4 | +.tags-block .tag_cloud a { | |
| 11 | 5 | text-decoration: none; |
| 12 | 6 | padding: 0px 4px; |
| 13 | 7 | } |
| 14 | 8 | |
| 15 | -.tag_cloud a:hover { | |
| 9 | +.tags-block .tag_cloud a:hover { | |
| 16 | 10 | color: red; |
| 17 | - background: #f0f0f0; | |
| 18 | 11 | } | ... | ... |
public/stylesheets/common.css
| ... | ... | @@ -332,8 +332,7 @@ body.category4 #content h1, body.category4 #content h2, body.category4 #content |
| 332 | 332 | body.category4 #content h4, body.category4 #content h5, body.category4 #content h6 |
| 333 | 333 | { color: #B80000 } |
| 334 | 334 | |
| 335 | -.block-title { | |
| 336 | - color: red; | |
| 335 | +#content .block-title { | |
| 337 | 336 | margin: 0px 0px 10px 0px; |
| 338 | 337 | } |
| 339 | 338 | ... | ... |