##// END OF EJS Templates
Activity view improvements:...
Jean-Philippe Lang -
r640:2f0edb0b61aa
parent child
Show More
@@ -463,7 +463,11 class ProjectsController < ApplicationController
463 @events_by_day = {}
463 @events_by_day = {}
464
464
465 unless params[:show_issues] == "0"
465 unless params[:show_issues] == "0"
466 @project.issues.find(:all, :include => [:author], :conditions => ["#{Issue.table_name}.created_on>=? and #{Issue.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
466 @project.issues.find(:all, :include => [:author], :conditions => ["#{Issue.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to] ).each { |i|
467 @events_by_day[i.created_on.to_date] ||= []
468 @events_by_day[i.created_on.to_date] << i
469 }
470 @project.issue_changes.find(:all, :include => :details, :conditions => ["(#{Journal.table_name}.created_on BETWEEN ? AND ?) AND (#{JournalDetail.table_name}.prop_key = 'status_id')", @date_from, @date_to] ).each { |i|
467 @events_by_day[i.created_on.to_date] ||= []
471 @events_by_day[i.created_on.to_date] ||= []
468 @events_by_day[i.created_on.to_date] << i
472 @events_by_day[i.created_on.to_date] << i
469 }
473 }
@@ -471,7 +475,7 class ProjectsController < ApplicationController
471 end
475 end
472
476
473 unless params[:show_news] == "0"
477 unless params[:show_news] == "0"
474 @project.news.find(:all, :conditions => ["#{News.table_name}.created_on>=? and #{News.table_name}.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
478 @project.news.find(:all, :conditions => ["#{News.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to], :include => :author ).each { |i|
475 @events_by_day[i.created_on.to_date] ||= []
479 @events_by_day[i.created_on.to_date] ||= []
476 @events_by_day[i.created_on.to_date] << i
480 @events_by_day[i.created_on.to_date] << i
477 }
481 }
@@ -479,7 +483,10 class ProjectsController < ApplicationController
479 end
483 end
480
484
481 unless params[:show_files] == "0"
485 unless params[:show_files] == "0"
482 Attachment.find(:all, :select => "#{Attachment.table_name}.*", :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
486 Attachment.find(:all, :select => "#{Attachment.table_name}.*",
487 :joins => "LEFT JOIN #{Version.table_name} ON #{Version.table_name}.id = #{Attachment.table_name}.container_id",
488 :conditions => ["#{Attachment.table_name}.container_type='Version' and #{Version.table_name}.project_id=? and #{Attachment.table_name}.created_on BETWEEN ? AND ?", @project.id, @date_from, @date_to],
489 :include => :author ).each { |i|
483 @events_by_day[i.created_on.to_date] ||= []
490 @events_by_day[i.created_on.to_date] ||= []
484 @events_by_day[i.created_on.to_date] << i
491 @events_by_day[i.created_on.to_date] << i
485 }
492 }
@@ -487,11 +494,14 class ProjectsController < ApplicationController
487 end
494 end
488
495
489 unless params[:show_documents] == "0"
496 unless params[:show_documents] == "0"
490 @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on>=? and #{Document.table_name}.created_on<=?", @date_from, @date_to] ).each { |i|
497 @project.documents.find(:all, :conditions => ["#{Document.table_name}.created_on BETWEEN ? AND ?", @date_from, @date_to] ).each { |i|
491 @events_by_day[i.created_on.to_date] ||= []
498 @events_by_day[i.created_on.to_date] ||= []
492 @events_by_day[i.created_on.to_date] << i
499 @events_by_day[i.created_on.to_date] << i
493 }
500 }
494 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id", :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on>=? and #{Attachment.table_name}.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
501 Attachment.find(:all, :select => "attachments.*",
502 :joins => "LEFT JOIN #{Document.table_name} ON #{Document.table_name}.id = #{Attachment.table_name}.container_id",
503 :conditions => ["#{Attachment.table_name}.container_type='Document' and #{Document.table_name}.project_id=? and #{Attachment.table_name}.created_on BETWEEN ? AND ?", @project.id, @date_from, @date_to],
504 :include => :author ).each { |i|
495 @events_by_day[i.created_on.to_date] ||= []
505 @events_by_day[i.created_on.to_date] ||= []
496 @events_by_day[i.created_on.to_date] << i
506 @events_by_day[i.created_on.to_date] << i
497 }
507 }
@@ -24,6 +24,7 class Project < ActiveRecord::Base
24 has_many :users, :through => :members
24 has_many :users, :through => :members
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
26 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
26 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
27 has_many :issue_changes, :through => :issues, :source => :journals
27 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
28 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
28 has_many :time_entries, :dependent => :delete_all
29 has_many :time_entries, :dependent => :delete_all
29 has_many :queries, :dependent => :delete_all
30 has_many :queries, :dependent => :delete_all
@@ -25,6 +25,10
25 <% if e.is_a? Issue %>
25 <% if e.is_a? Issue %>
26 <%= e.created_on.strftime("%H:%M") %> <%= link_to_issue e %>: <%=h e.subject %><br />
26 <%= e.created_on.strftime("%H:%M") %> <%= link_to_issue e %>: <%=h e.subject %><br />
27 <i><%= e.author.name %></i>
27 <i><%= e.author.name %></i>
28 <% elsif e.is_a? Journal %>
29 <%= e.created_on.strftime("%H:%M") %> <%= link_to_issue e.journalized %>
30 (<%=h (status = IssueStatus.find_by_id(e.details.first.value)) ? status.name : '?' %>): <%=h e.journalized.subject %><br />
31 <em><%=h e.user.name %><%=h ": #{truncate(e.notes, 500)}" unless e.notes.blank? %></em>
28 <% elsif e.is_a? News %>
32 <% elsif e.is_a? News %>
29 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
33 <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
30 <% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
34 <% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
@@ -53,16 +57,15
53 <% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
57 <% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
54
58
55 <div style="float:left;">
59 <div style="float:left;">
60 <% prev_params = params.clone.update :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) %>
56 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
61 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
57 {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
62 {:update => "content", :url => prev_params}, {:href => url_for(prev_params)} %>
58 {:href => url_for(:action => 'activity', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
59 %>
60 </div>
63 </div>
61 <div style="float:right;">
64 <div style="float:right;">
65 <% next_params = params.clone.update :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) %>
62 <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
66 <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
63 {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
67 {:update => "content", :url => next_params}, {:href => url_for(next_params)} %>
64 {:href => url_for(:action => 'activity', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
68 &nbsp;
65 %>&nbsp;
66 </div>
69 </div>
67 <br />
70 <br />
68 </div>
71 </div>
General Comments 0
You need to be logged in to leave comments. Login now