项目里程碑详情页面
This commit is contained in:
parent
295524af5c
commit
64dd693e6f
|
@ -76,11 +76,20 @@ class VersionsController < ApplicationController
|
|||
|
||||
def show
|
||||
respond_to do |format|
|
||||
@issues = @version.fixed_issues.visible.
|
||||
includes(:status, :tracker, :priority).
|
||||
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||||
all
|
||||
@issue_count = @issues.count
|
||||
@limit = 20
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||
# @offset ||= @issue_pages.offset
|
||||
@issues = paginateHelper @issues, @limit
|
||||
format.html {
|
||||
@issues = @version.fixed_issues.visible.
|
||||
includes(:status, :tracker, :priority).
|
||||
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||||
all
|
||||
# @issues = @version.fixed_issues.visible.
|
||||
# includes(:status, :tracker, :priority).
|
||||
# reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||||
# all
|
||||
}
|
||||
format.api
|
||||
# format.xls {
|
||||
|
|
|
@ -1854,6 +1854,16 @@ module ApplicationHelper
|
|||
link_to l(:button_delete), url, options
|
||||
end
|
||||
|
||||
def delete_version_link(url, options={})
|
||||
options = {
|
||||
:method => :delete,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'icon icon-del'
|
||||
}.merge(options)
|
||||
|
||||
link_to "", url, options
|
||||
end
|
||||
|
||||
def delete_link_version(url, options={})
|
||||
options = {
|
||||
:method => :delete,
|
||||
|
@ -1923,12 +1933,11 @@ module ApplicationHelper
|
|||
pcts << (100 - pcts[0])
|
||||
width = options[:width] || '100px;'
|
||||
legend = options[:legend] || ''
|
||||
content_tag('table',
|
||||
content_tag('tr',
|
||||
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed', :title => "已关闭:#{pcts[0]}%") : ''.html_safe) +
|
||||
(pcts[0] > 0 ? content_tag('span', '', :style => "width: 300px;", :class => 'roadmap_progressbar ml5', :title => "已关闭:#{pcts[0]}%") : ''.html_safe) +
|
||||
# (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => "开发中:#{pcts[1]}%") : ''.html_safe) +
|
||||
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'todo', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
|
||||
), :class => 'progress').html_safe
|
||||
(pcts[1] > 0 ? content_tag('span', '', :style => "width: 300px;", :class => 'roadmap_progressbar ml5', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
|
||||
)
|
||||
# + content_tag('p', legend, :class => 'percent').html_safe
|
||||
end
|
||||
|
||||
|
|
|
@ -1,23 +1,56 @@
|
|||
<!--Modified by young-->
|
||||
<% if version.issues_count > 0 %>
|
||||
<p class="f14 mb5">»<%= l(:label_versions_progress)%></p>
|
||||
<%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<p class="progress-info">
|
||||
<%#= link_to(l(:label_x_issues, :count => version.issues_count),
|
||||
project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %>
|
||||
<a class="c_dblue" target="_blank"><%=version.issues_count%> 问题</a>
|
||||
|
||||
(<%#= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count),
|
||||
project_issues_path(version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>
|
||||
<% if version.closed_issues_count > 0 %>
|
||||
<a class="c_dblue" target="_blank"><%end%><%=version.closed_issues_count%> 已关闭</a>
|
||||
—
|
||||
<%#= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count),
|
||||
project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>
|
||||
<% if version.open_issues_count > 0%>
|
||||
<a class="c_dblue" target="_blank"><%end%><%=version.open_issues_count%> 打开</a>
|
||||
)
|
||||
</p>
|
||||
<li>已关闭 <span class="ml5 "><%=version.closed_issues_count%></span></li>
|
||||
<li><span >/</span></li>
|
||||
<li>issues<span class="ml5 "><%=version.issues_count%></span></li>
|
||||
<li>
|
||||
<%= progress_bar([version.closed_percent], :width => '300px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<span class="ml5 c_red">
|
||||
<%= version.closed_percent.to_i == 0 ? 0 : version.closed_percent %>%
|
||||
</span>
|
||||
</li>
|
||||
<%#= labelled_form_for @version,:html=>{:id=>"new_project_version_form"} do |f| %>
|
||||
<%#= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]}, :class=>"fr new_roadmap_select", :blur => "remote_function(#new_project_version_form);"%>
|
||||
<%# end %>
|
||||
<%= form_tag({:controller => 'versions', :action => 'update', :version => @version},:remote=>'true', :method =>:put, :id=>"version-#{@version.id}-status-form", :class => 'fr new_roadmap_select') do %>
|
||||
<%= select( :versions, :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},
|
||||
{ :include_blank => false, :selected=> @version.status ? @version.status : 0},
|
||||
{ :onchange=>"remote_function('#version-#{@version.id}-status-form');", :id =>"status", :name => "status",:class=>"fr new_roadmap_select"}) %>
|
||||
<% end %>
|
||||
|
||||
<%= delete_version_link version_path(@version, :back_url => url_for(:controller => 'versions',
|
||||
:action => 'index',
|
||||
:project_id => @version.project)),:class=>'roadmap_icons_del fr mt5 mr5' if User.current.allowed_to?(:manage_versions, @version.project) %>
|
||||
<%= link_to("", edit_version_path(@version), :class => 'roadmap_icons_edit fr mt5 ') if User.current.allowed_to?(:manage_versions, @version.project) %>
|
||||
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
|
||||
<% else %>
|
||||
<div class="flash error"><%= l(:label_roadmap_no_issues) %></div>
|
||||
<% end %>
|
||||
|
||||
<!--Modified by young-->
|
||||
<%# if version.issues_count > 0 %>
|
||||
<!-- <p class="f14 mb5">»<%#= l(:label_versions_progress)%></p>
|
||||
<%#= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<p class="progress-info">
|
||||
<%#= link_to(l(:label_x_issues, :count => version.issues_count),
|
||||
project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %>
|
||||
<a class="c_dblue" target="_blank"><%#=version.issues_count%> 问题</a>
|
||||
|
||||
(<%#= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count),
|
||||
project_issues_path(version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>
|
||||
<%# if version.closed_issues_count > 0 %>
|
||||
<a class="c_dblue" target="_blank"><%#end%><%#=version.closed_issues_count%> 已关闭</a>
|
||||
—
|
||||
<%#= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count),
|
||||
project_issues_path(version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue") %>
|
||||
<%# if version.open_issues_count > 0%>
|
||||
<a class="c_dblue" target="_blank"><%#end%><%#=version.open_issues_count%> 打开</a>
|
||||
)
|
||||
</p>
|
||||
<%# else %>
|
||||
<div class="flash error"><%#= l(:label_roadmap_no_issues) %></div>
|
||||
<%# end %>-->
|
||||
<script>
|
||||
function remote_function(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
|
@ -1,3 +1,136 @@
|
|||
<!--里程碑详情开始-->
|
||||
<div class="new_roadmap_conbox mb10" >
|
||||
<div class="new_roadmap_info_top clear ">
|
||||
<a href="<%= project_roadmap_path(@project) %>" class="fl linkBlue2 mt3" >
|
||||
<span class="new_roadmap_icons_back mr5"></span>
|
||||
返回里程碑列表
|
||||
</a>
|
||||
<span class="ml5 mr5 fl f14">|</span>
|
||||
<h4 class="fl new_roadmap_listtitle"><%= h(@version.name) %></h4>
|
||||
<span class="fl roadmap_blueicon mt3 ml5"></span>
|
||||
<p class="fr mt3 c_grey02">
|
||||
<span class="muban-icons-clock "></span>
|
||||
<% if @version.completed? %>
|
||||
<%= format_date(@version.effective_date) %>
|
||||
<% elsif @version.effective_date %>
|
||||
<%= due_date_distance_in_words(@version.effective_date) %>(<%= format_date(@version.effective_date) %>)
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="clear new_roadmap_listbox">
|
||||
<ul class="new_roadmap_list_txt clear mb5">
|
||||
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
|
||||
</ul>
|
||||
<div class="c_grey02">
|
||||
<p><%= @version.description %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="new_roadmap_conbox " >
|
||||
<div class=" clear">
|
||||
<ul class="new_roadmap_nav fl" >
|
||||
<li id="new_roadmap_nav_1" class="new_roadmap_nav_hover " onclick="HoverLi(1);">
|
||||
<a href="javascript:void(0);" id="new_roadmap_type_1" class="new_roadmap_type_nomal" >所有issues</a>
|
||||
</li>
|
||||
<li id="new_roadmap_nav_2" onclick="HoverLi(2);" >
|
||||
<a href="javascript:void(0);" id="new_roadmap_type_2" class="new_roadmap_type_nomal" >issues统计</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="new_roadmap_content_1">
|
||||
<div class="pd15box">
|
||||
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>标题</th>
|
||||
<th>类型</th>
|
||||
<th>指派给</th>
|
||||
<th>更新时间</th>
|
||||
<th>状态</th>
|
||||
<th>完成度</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @issues.each do |issue| %>
|
||||
<tr>
|
||||
<td>#<%= issue.id %></td>
|
||||
<td><p class="new_roadmap_info_title" title="<%= issue.subject %>"><%= issue.subject %></p> </td>
|
||||
<td> <%= issue.tracker %> </td>
|
||||
<td><p class="new_roadmap_info_name"><%= User.find(issue.try(:assigned_to_id)).show_name %></p></td>
|
||||
<td><%= format_time issue.updated_on %></td>
|
||||
<td><%= issue.status.name %></td>
|
||||
<td><span class="<%= issue.done_ratio == 100 ? "c_green" : "c_red" %>" ><%= issue.done_ratio %>%</span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%= link_to "导出", version_path(@version, :format => 'xls'), :class=>"btn_newpro_grey fl mt10 ml15 "%>
|
||||
<div class="pages fr" style="width:auto; display:inline-block; margin-right:10px;">
|
||||
<div>
|
||||
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--翻页 end-->
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
</div><!--new_roadmap_content_1 end-->
|
||||
<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>
|
||||
</div>
|
||||
<!--缺陷列表结束-->
|
||||
|
||||
</div><!--new_roadmap_content_2 end-->
|
||||
</div><!--new_roadmap end-->
|
||||
<!--里程碑详情结束-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!--modified by young-->
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_roadmap) %></h2>
|
||||
|
@ -83,5 +216,19 @@
|
|||
<% html_title @version.name %>
|
||||
|
||||
<script>
|
||||
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
|
||||
//issues列表
|
||||
function g(o){
|
||||
return document.getElementById(o);
|
||||
}
|
||||
function HoverLi(n){
|
||||
//如果有N个标签,就将i<=N;
|
||||
for(var i=1;i<=2;i++){
|
||||
g('new_roadmap_nav_'+i).className='new_roadmap_nav_nomal';
|
||||
g('new_roadmap_type_'+i).className='new_roadmap_type_nomal';
|
||||
g('new_roadmap_content_'+i).className='undis';
|
||||
}
|
||||
g('new_roadmap_nav_'+n).className='new_roadmap_nav_hover';
|
||||
g('new_roadmap_type_'+n).className='new_roadmap_type_hover';
|
||||
g('new_roadmap_content_'+n).className='dis';
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue