Skip to content

Commit

Permalink
Fix wrong counters
Browse files Browse the repository at this point in the history
  • Loading branch information
atd committed Dec 30, 2010
1 parent f7464fa commit 820979e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/views/actors/_contacts.html.erb
@@ -1,14 +1,14 @@
<% if actor.contacts.present? %>
<% if (cs = actor.contacts.all).present? %>

<div class="contacts_header">
<%=image_tag("btn/btn_friend.png", :class => "contacts_icon")%>
<div class="contacts_text_header">
<%= actor.contacts.count %> <%= t('contact', :count => actor.contacts.count) %>
<%= cs.count %> <%= t('contact', :count => cs.count) %>
</div>
</div>
<div class ="contacts">
<div class="contact">
<% actor.contacts.all.each do |contact| %>
<% cs.each do |contact| %>
<%= link_to(image_tag(contact.logo.url, :alt => contact.name , :size => "40x40"), contact) %>
<% end %>
</div>
Expand Down
12 changes: 7 additions & 5 deletions app/views/home/_groups.html.erb
@@ -1,9 +1,10 @@
<% if current_user.recent_groups.any? %>
<% if (groups = current_user.recent_groups.all).any? %>
<div id="groups_title" class="content_size">
<%=t('group.last') %> (<span id="group_count"><%=current_user.recent_groups.count%></span>)
<%=t('group.last') %> (<span id="group_count"><%= groups.count %></span>)
</div>

<div id="groups_list" class="content_size">
<% if (current_user.recent_groups.count) > 10 %>
<% if (groups.count) > 10 %>
<div id='carousel_container'>
<div id='left_scroll'><%=image_tag("btn/group_left.png")%></div>
<div id='carousel_inner'>
Expand All @@ -12,8 +13,9 @@
<div class="space_center"></div>
<%end%>
<%= render current_user.recent_groups %>
<% if (current_user.recent_groups.count) > 10 %>
<%= render groups %>
<% if (groups.count) > 10 %>
</ul>
</div>
<div id='right_scroll'><%=image_tag("btn/group_right.png")%></div>
Expand Down

0 comments on commit 820979e

Please sign in to comment.