changeset 349:c46fbe5d58ce live

Merge from branch "feature_122"
author Chris Cannam
date Thu, 31 Mar 2011 15:23:55 +0100
parents 8d0e011332ef (diff) 361602c5e6bb (current diff)
children 9ccc63655a21
files app/views/projects/show.rhtml
diffstat 8 files changed, 68 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/files_controller.rb	Thu Mar 31 15:21:24 2011 +0100
+++ b/app/controllers/files_controller.rb	Thu Mar 31 15:23:55 2011 +0100
@@ -8,7 +8,7 @@
   include SortHelper
 
   def index
-    sort_init 'active', 'asc'
+    sort_init 'active', 'desc'
     sort_update 'filename' => "#{Attachment.table_name}.filename",
 		'active' => "#{Attachment.table_name}.active",
                 'created_on' => "#{Attachment.table_name}.created_on",
--- a/app/controllers/my_controller.rb	Thu Mar 31 15:21:24 2011 +0100
+++ b/app/controllers/my_controller.rb	Thu Mar 31 15:23:55 2011 +0100
@@ -24,14 +24,15 @@
   BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
              'issuesreportedbyme' => :label_reported_issues,
              'issueswatched' => :label_watched_issues,
+             'activitymyprojects' => :label_activity_my_recent,
              'news' => :label_news_latest,
              'calendar' => :label_calendar,
              'documents' => :label_document_plural,
              'timelog' => :label_spent_time
            }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze
 
-  DEFAULT_LAYOUT = {  'left' => ['issuesassignedtome'], 
-                      'right' => ['issuesreportedbyme'] 
+  DEFAULT_LAYOUT = {  'left' => ['activitymyprojects'], 
+                      'right' => ['issueswatched','calendar'] 
                    }.freeze
 
   verify :xhr => true,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/activities/_recent.rhtml	Thu Mar 31 15:23:55 2011 +0100
@@ -0,0 +1,51 @@
+<% events = @events_by_day %>
+<% max = 5 %>
+<% if (events.nil?) 
+     activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
+     events = activity.events(Date.today - 28, Date.today + 1).first(max)
+   end
+%>
+
+<div id="activity">
+
+<% if @project.nil? %>
+   <%= content_tag('h3', l(:label_activity_my_recent)) %>
+   <div class="activity box">
+<% end %>
+
+<% if events.empty? %>
+
+   <% if @project.nil? %>
+     <p><%= l(:label_activity_my_recent_none) %></p>
+   <% end %>
+
+<% else %>
+
+   <% if !@project.nil? %>
+     <div class="activity box">
+     <%= content_tag('h3', l(:label_activity_recent)) %>
+   <% end %>
+
+   <dl>
+   <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
+     <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
+	<%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
+     <span class="time"><%= format_time(e.event_datetime) %></span>
+     <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
+     <% if e.respond_to?(:event_author) %>
+       <span class="author"><%= e.event_author %></span>
+     <% end %>
+     </dt>
+     <dd><%= link_to format_activity_title(e.event_title), e.event_url %>
+     <span class="description"><%= format_activity_description(e.event_description) %></span>
+     </dd>
+   <% end -%>
+   </dl>
+
+   </div>
+
+<% end %>
+
+<% if events.empty? and @project.nil? %></div><% end %>
+
+</div>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/views/my/blocks/_activitymyprojects.rhtml	Thu Mar 31 15:23:55 2011 +0100
@@ -0,0 +1,4 @@
+
+<%= render :partial => 'activities/recent' %>
+
+
--- a/app/views/projects/show.rhtml	Thu Mar 31 15:21:24 2011 +0100
+++ b/app/views/projects/show.rhtml	Thu Mar 31 15:23:55 2011 +0100
@@ -49,6 +49,7 @@
   </div>
 
   <% end %>
+
   <%= call_hook(:view_projects_show_left, :project => @project) %>
 </div>
 
@@ -62,6 +63,9 @@
     <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
   </div>  
   <% end %>
+
+  <%= render :partial => 'activities/recent' %>
+
   <%= call_hook(:view_projects_show_right, :project => @project) %>
 </div>
 
--- a/config/locales/en.yml	Thu Mar 31 15:21:24 2011 +0100
+++ b/config/locales/en.yml	Thu Mar 31 15:23:55 2011 +0100
@@ -518,6 +518,9 @@
   label_last_login: Last connection
   label_registered_on: Registered on
   label_activity: Activity
+  label_activity_recent: Recent activity
+  label_activity_my_recent: Recent activity in my projects
+  label_activity_my_recent_none: No recent activity
   label_overall_activity: Overall activity
   label_user_activity: "{{value}}'s activity"
   label_new: New
--- a/extra/soundsoftware/reposman-soundsoftware.rb	Thu Mar 31 15:21:24 2011 +0100
+++ b/extra/soundsoftware/reposman-soundsoftware.rb	Thu Mar 31 15:23:55 2011 +0100
@@ -346,14 +346,5 @@
     log("\trepository #{repos_path} created");
   end
 
-  if project.respond_to?(:repository) and project.repository.is_external?
-    external_url = project.repository.external_url;
-    log("\tproject #{project.identifier} has external repository url #{external_url}");
-    if !external_url.match(/^https?:/)
-      # wot about git, svn/svn+ssh, etc? should we just check for a scheme at all?
-      log("\tthis is not an http(s) url: ignoring");
-    end
-  end
-
 end
   
--- a/public/stylesheets/application.css	Thu Mar 31 15:21:24 2011 +0100
+++ b/public/stylesheets/application.css	Thu Mar 31 15:23:55 2011 +0100
@@ -216,6 +216,7 @@
 h3.version { background: url(../images/package.png) no-repeat 0% 50%; padding-left: 20px; }
 
 div.issues h3 { background: url(../images/ticket.png) no-repeat 0% 50%; padding-left: 20px; }
+div.activity h3 { background: url(../images/ticket.png) no-repeat 0% 50%; padding-left: 20px; }
 div.members h3 { background: url(../images/group.png) no-repeat 0% 50%; padding-left: 20px; }
 div.news h3 { background: url(../images/news.png) no-repeat 0% 50%; padding-left: 20px; }
 div.projects h3 { background: url(../images/projects.png) no-repeat 0% 50%; padding-left: 20px; }
@@ -294,6 +295,7 @@
 div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
 
 div#activity dl, #search-results { margin-left: 2em; }
+div#activity .box dl { margin-left: 0; }
 div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
 div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
 div#activity dt.me .time { border-bottom: 1px solid #999; }