changeset 1021:967fb7e62b1d browsing

Include only public projects in busy institutions / projects queries, so results can be cached (the tag cloud was already public projects only). Introduce tentatively some cacheing thingies
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 13 Nov 2012 10:35:23 +0000
parents e816ffefcb71
children f2ec92061fca
files app/views/activities/_busy.html.erb app/views/activities/_busy_institution.html.erb app/views/projects/explore.html.erb
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/activities/_busy.html.erb	Tue Nov 13 10:24:11 2012 +0000
+++ b/app/views/activities/_busy.html.erb	Tue Nov 13 10:35:23 2012 +0000
@@ -1,6 +1,6 @@
 <% events = @events_by_day %>
 <% if (events.nil?) 
-     activity = Redmine::Activity::Fetcher.new(User.current)
+     activity = Redmine::Activity::Fetcher.new(User.anonymous)
      events = activity.events(Date.today - 14, Date.today + 1)
    end
 %>
--- a/app/views/activities/_busy_institution.html.erb	Tue Nov 13 10:24:11 2012 +0000
+++ b/app/views/activities/_busy_institution.html.erb	Tue Nov 13 10:35:23 2012 +0000
@@ -1,6 +1,6 @@
 <% events = @events_by_day %>
 <% if (events.nil?) 
-     activity = Redmine::Activity::Fetcher.new(User.current)
+     activity = Redmine::Activity::Fetcher.new(User.anonymous)
      days = Setting.activity_days_default.to_i
      events = activity.events(Date.today - days, Date.today + 1)
    end
@@ -25,3 +25,4 @@
     <% end %>
   </ul>
 <% end %>
+
--- a/app/views/projects/explore.html.erb	Tue Nov 13 10:24:11 2012 +0000
+++ b/app/views/projects/explore.html.erb	Tue Nov 13 10:35:23 2012 +0000
@@ -1,23 +1,29 @@
 
+<% cache(:action => 'explore', :action_suffix => 'tags') do %>
 <h2><%= l(:label_explore_projects) %></h2>
-
   <div class="tags box">
   <h3><%=l(:label_project_tags_all)%></h3>
     <%= render :partial => 'projects/tagcloud' %>
   </div>
+<% end %>
+
 <div class="splitcontentleft">
+  <% cache(:action => 'explore', :action_suffix => 'busy_institutions') do %>
   <div class="institutions box">
   <h3><%=l(:label_institutions_busy)%></h3>
     <%= render :partial => 'activities/busy_institution' %>
   </div>
+  <% end %>
   <div class="projects box">
   <h3><%=l(:label_project_latest)%></h3>
     <%= render :partial => 'projects/latest' %>
   </div>
 </div>
 <div class="splitcontentright">
+  <% cache(:action => 'explore', :action_suffix => 'busy_projects') do %>
   <div class="projects box">
   <h3><%=l(:label_projects_busy)%></h3>
     <%= render :partial => 'activities/busy' %>
   </div>
+  <% end %>
 </div>