# HG changeset patch # User Chris Cannam # Date 1352802923 0 # Node ID 967fb7e62b1d7a442ba7a5e398a6b07668792796 # Parent e816ffefcb71247b73ccadd4692c43c8aa6f9d8d 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 diff -r e816ffefcb71 -r 967fb7e62b1d app/views/activities/_busy.html.erb --- 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 %> diff -r e816ffefcb71 -r 967fb7e62b1d app/views/activities/_busy_institution.html.erb --- 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 %> <% end %> + diff -r e816ffefcb71 -r 967fb7e62b1d app/views/projects/explore.html.erb --- 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 %>

<%= l(:label_explore_projects) %>

-

<%=l(:label_project_tags_all)%>

<%= render :partial => 'projects/tagcloud' %>
+<% end %> +
+ <% cache(:action => 'explore', :action_suffix => 'busy_institutions') do %>

<%=l(:label_institutions_busy)%>

<%= render :partial => 'activities/busy_institution' %>
+ <% end %>

<%=l(:label_project_latest)%>

<%= render :partial => 'projects/latest' %>
+ <% cache(:action => 'explore', :action_suffix => 'busy_projects') do %>

<%=l(:label_projects_busy)%>

<%= render :partial => 'activities/busy' %>
+ <% end %>