Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
huang 2016-10-24 10:57:34 +08:00
commit 7eeefecdef
4 changed files with 40 additions and 46 deletions

View File

@ -114,15 +114,16 @@ class VersionsController < ApplicationController
def show
respond_to do |format|
@issues = @version.fixed_issues.visible.
@version_issues = @version.fixed_issues.visible.
includes(:status, :tracker, :priority).
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
all
@issue_count = @issues.count
@issue_count = @version_issues.count
@limit = 20
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
# @offset ||= @issue_pages.offset
@issues = paginateHelper @issues, @limit
@issues = paginateHelper @version_issues, @limit
@version_issue_assigned_name = @version_issues.group_by(&:assigned_to_id)
format.html {
# @issues = @version.fixed_issues.visible.
# includes(:status, :tracker, :priority).

View File

@ -0,0 +1,29 @@
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>指派给</th>
<th>全部</th>
<th>完成</th>
<th>关闭</th>
<th>待完成</th>
</tr>
</thead>
<tbody>
<% @version_issue_assigned_name.each do | assigned | %>
<tr>
<td><%= User.find(assigned[0]).show_name %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0]).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0], :status_id => 3).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id,:assigned_to_id => assigned[0], :status_id => 5).count %></td>
<td><%= Issue.where(fixed_version_id: @version.id, assigned_to_id: assigned[0], status_id: [1,2,4]).count %></td>
</tr>
<% end %>
<tr>
<td>Total</td>
<td><%= Issue.where(:fixed_version_id => @version.id).count %> </td>
<td><%= Issue.where(:fixed_version_id => @version.id, :status_id => 3).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id, :status_id => 5).count %></td>
<td><%= Issue.where(fixed_version_id: @version.id, status_id: [1,2,4]).count %></td>
</tr>
</tbody>
</table>

View File

@ -12,9 +12,12 @@
<li>已关闭<span class="ml5 "><%= version.closed_issues_count %> </span></li>
<li>
<% if version.completed? %>
<span></span><%= format_date(version.effective_date) %>
<%= format_date(version.effective_date) %>
<% elsif version.effective_date %>
<span class="muban-icons-clock"></span><%= due_date_distance_in_words(version.effective_date) %>(<%= format_date(version.effective_date) %>)
<span class="muban-icons-clock"></span>
<span class="<%= version.effective_date < Date.today ? "c_red" : "" %>">
<%= due_date_distance_in_words(version.effective_date) %>(<%= format_date(version.effective_date) %>)
</span>
<% end %>
<!--<span ></span>截止日期剩余 5天(2016-10-31)</li>-->
</ul>

View File

@ -82,47 +82,8 @@
<div id="new_roadmap_content_2" class="undis">
<!--缺陷统计开始-->
<div class=" ml15 mr10 mb15">
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>指派给</th>
<th>全部</th>
<th>完成</th>
<th>关闭</th>
<th>待完成</th>
</tr>
</thead>
<tbody>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>李冰冰</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
<tr>
<td>Total</td>
<td>29</td>
<td>5</td>
<td>4</td>
<td>1</td>
</tr>
</tbody>
</table>
<%= render :partial => 'versions/issue_statistics', :locals => {:version => @version} %>
</div>
<!--缺陷列表结束-->