myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [1910] branches/event_logging/app: Fixed the layo


From: noreply
Subject: [myexperiment-hackers] [1910] branches/event_logging/app: Fixed the layout on users index page: " last updated" tab is back in place & now displays users with the lately updated profiles ; "most recent" tab view changed to "table listing" view.
Date: Fri, 31 Oct 2008 07:33:17 -0400 (EDT)

Revision
1910
Author
alekses6
Date
2008-10-31 07:33:15 -0400 (Fri, 31 Oct 2008)

Log Message

Fixed the layout on users index page: "last updated" tab is back in place & now displays users with the lately updated profiles; "most recent" tab view changed to "table listing" view.

Modified Paths

Diff

Modified: branches/event_logging/app/models/user.rb (1909 => 1910)


--- branches/event_logging/app/models/user.rb	2008-10-30 18:01:01 UTC (rev 1909)
+++ branches/event_logging/app/models/user.rb	2008-10-31 11:33:15 UTC (rev 1910)
@@ -39,7 +39,7 @@
   end
   
   def self.last_updated(limit=5)
-    self.find_by_sql ["SELECT u.*, p.* FROM users u, profiles p WHERE u.id = p.user_id and activated_at IS NOT NULL ORDER BY GREATEST(u.updated_at, p.updated_at) DESC LIMIT ?", limit]
+    self.find(:all, :joins => "LEFT OUTER JOIN profiles ON profiles.user_id = users.id", :conditions => ["users.activated_at IS NOT NULL"], :order => "profiles.updated_at DESC", :limit => limit)
   end
   
   def self.last_active(limit=5)

Modified: branches/event_logging/app/views/users/index.rhtml (1909 => 1910)


--- branches/event_logging/app/views/users/index.rhtml	2008-10-30 18:01:01 UTC (rev 1909)
+++ branches/event_logging/app/views/users/index.rhtml	2008-10-31 11:33:15 UTC (rev 1910)
@@ -6,16 +6,15 @@
 
 <div id="tabsContainer" class="tabsContainer"></div>
 
-<% unless (recent = User.most_recent(6)).empty? %>
+<% unless (recent = User.most_recent(10)).empty? %>
   <div class="tabContainer">
   	<div class="tabTitle">Most Recent</div>
   	<div class="tabContent">
-	    <%= render :partial => "users/hlist", :locals => { :collection => recent } %>
+	    <%= render :partial => "users/table", :locals => { :collection => recent } %>
   	</div>
   </div>
 <% end %>
 
-<% if false -%>
 <% unless (updated = User.last_updated(10)).empty? %>
   <div class="tabContainer">
   	<div class="tabTitle">Last Updated</div>
@@ -24,7 +23,6 @@
   	</div>
   </div>
 <% end %>
-<% end -%>
 
 <% unless (active = User.last_active(10)).empty? %>
   <div class="tabContainer">

reply via email to

[Prev in Thread] Current Thread [Next in Thread]