From 71d6dc6d21c9a31c172b02afbfe428b1cdcc7117 Mon Sep 17 00:00:00 2001 From: nieguanghui Date: Tue, 20 Aug 2013 15:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E8=AF=84=E8=AE=BA=E6=95=B0=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 4 +-- app/views/projects/show.html.erb | 2 +- app/views/users/show.html.erb | 38 +++++++++++++++++++------- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 84417858..45128395 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -100,7 +100,7 @@ class ProjectsController < ApplicationController @project_count = @projects.count @project_pages = Paginator.new @project_count, @limit, params['page'] @offset ||= @project_pages.offset - @projects = @projects.offset(@offset).limit(@limit).order('lft').all + @projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all #end respond_to do |format| format.html { @@ -109,7 +109,7 @@ class ProjectsController < ApplicationController unless params[:closed] scope = scope.active end - @projects = scope.visible.offset(@offset).limit(@limit).order('lft').all + @projects = scope.visible.offset(@offset).limit(@limit).order('created_on DESC').all } format.api { # @offset, @limit = api_offset_and_limit diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index e838538c..12adb3b5 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -23,7 +23,7 @@ <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> - <% if e.class == Issue %> + <% if e.event_type == "issue" %> <%= link_to l(:label_find_all_comments), issue_path(e) %><%= l(:label_comments_count, :count => e.journals.count)%> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index aea34195..c88ea171 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -24,6 +24,9 @@ <%= textilizable act.description %>

+ + +
<%= link_to l(:label_find_all_comments), respond_path(e.act_id) %><%= l(:label_comments_count, :count => e.act.commit)%>
<% when 'Journal' %> <% if e.user == User.current%> @@ -38,6 +41,9 @@ <%= textilizable act.notes %>

+ + +
<% when 'Changeset' %> <% if e.user == User.current%> @@ -52,6 +58,9 @@ <%= textilizable act.long_comments %>

+ + +
<%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %><%= l(:label_comments_count, :count => e.act.count)%>
<% when 'Message' %> <% if e.user == User.current%> @@ -66,6 +75,9 @@ <%= textilizable act.content %>

+ + +
<% when 'News' %> <% if e.user == User.current%> @@ -80,6 +92,9 @@ <%= textilizable act.description %>

+ + +
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.comments_count)%>
<% when 'Issue' %> <% if e.user == User.current%> @@ -94,31 +109,34 @@ <%= textilizable act.description %>

- <% end %> + - - - <% if e.act_type == 'Changeset' %> + +
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %><%= l(:label_comments_count, :count => e.act.journals.count)%>
+ <% end %> +
<% if e.act_type == 'Changeset' %> <%= format_time(e.act.committed_on) %> <% else %> <%= format_time(e.act.created_on) %> - <% end %> + <% end %>
+ <% end %> - - + <% end %> - + - <% else %> -

<%= l(:label_user_activities) %>

+<% else %> +

+ <%= l(:label_user_activities) %> +

<% end %> \ No newline at end of file