增加用户活动评论数显示

This commit is contained in:
nieguanghui 2013-08-20 15:12:49 +08:00
parent fba39b4b00
commit 71d6dc6d21
3 changed files with 31 additions and 13 deletions

View File

@ -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

View File

@ -23,7 +23,7 @@
<tr>
<td align="left"><a class="font_lighter"><%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></a></td>
<% if e.class == Issue %>
<% if e.event_type == "issue" %>
<td align="right"><span><%= link_to l(:label_find_all_comments), issue_path(e) %></span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td>
<% end %>
</tr>

View File

@ -24,6 +24,9 @@
<%= textilizable act.description %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit)%></a></div>
<% when 'Journal' %>
<tr>
<% if e.user == User.current%>
@ -38,6 +41,9 @@
<%= textilizable act.notes %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'Changeset' %>
<tr>
<% if e.user == User.current%>
@ -52,6 +58,9 @@
<%= textilizable act.long_comments %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count)%></a></div>
<% when 'Message' %>
<tr>
<% if e.user == User.current%>
@ -66,6 +75,9 @@
<%= textilizable act.content %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'News' %>
<tr>
<% if e.user == User.current%>
@ -80,6 +92,9 @@
<%= textilizable act.description %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count)%></a></div>
<% when 'Issue' %>
<tr>
<% if e.user == User.current%>
@ -94,31 +109,34 @@
<%= textilizable act.description %>
</p></td>
</tr>
<% end %>
<!--modified by nie -->
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a"><span class="font_lighter">
<% if e.act_type == 'Changeset' %>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count)%></a></div>
<% end %>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"><span class="font_lighter"> <% if e.act_type == 'Changeset' %>
<%= format_time(e.act.committed_on) %>
<% else %>
<%= format_time(e.act.created_on) %>
<% end %></span></td>
<% end %></span></div>
</td>
</tr>
<!-- <tr><div class="line_under"></div></tr> -->
</table></td>
</tr>
</table>
<% end %>
<% end %>
</div>
</div>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @activity_pages %>
<ul>
</div>
<% else %>
<p class="font_description"><%= l(:label_user_activities) %></p>
<% else %>
<p class="font_description">
<%= l(:label_user_activities) %>
</p>
<% end %>