Merge branch 'rep_quality' of https://git.trustie.net/jacknudt/trustieforge into rep_quality
This commit is contained in:
commit
cda32cdda9
|
@ -66,16 +66,16 @@ class IssuesController < ApplicationController
|
||||||
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
|
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
|
||||||
|
|
||||||
if @query.valid?
|
if @query.valid?
|
||||||
case params[:format]
|
# case params[:format]
|
||||||
when 'csv', 'pdf'
|
# when 'csv', 'pdf'
|
||||||
@limit = 10#Setting.issues_export_limit.to_i
|
# @limit = 10#Setting.issues_export_limit.to_i
|
||||||
when 'atom'
|
# when 'atom'
|
||||||
@limit = 10#Setting.feeds_limit.to_i
|
# @limit = 10#Setting.feeds_limit.to_i
|
||||||
when 'xml', 'json'
|
# when 'xml', 'json'
|
||||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
# @offset, @limit = api_offset_and_limit({:limit => 10})
|
||||||
else
|
# else
|
||||||
@limit = 10#per_page_option
|
# @limit = 10#per_page_option
|
||||||
end
|
# end
|
||||||
@assign_to_id = params[:assigned_to_id]
|
@assign_to_id = params[:assigned_to_id]
|
||||||
@author_id = params[:author_id]
|
@author_id = params[:author_id]
|
||||||
@priority_id = params[:priority_id]
|
@priority_id = params[:priority_id]
|
||||||
|
@ -83,17 +83,23 @@ class IssuesController < ApplicationController
|
||||||
@subject = params[:subject]
|
@subject = params[:subject]
|
||||||
@done_ratio = params[:done_ratio]
|
@done_ratio = params[:done_ratio]
|
||||||
@issue_count = @query.issue_count
|
@issue_count = @query.issue_count
|
||||||
@issue_pages = Paginator.new @issue_count, @limit, params['page']
|
# @issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||||
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
# params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
||||||
|
# @offset ||= @issue_pages.offset
|
||||||
|
@issues_filter = @query.issues
|
||||||
|
# (:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
||||||
|
# :order => 'issues.updated_on desc',
|
||||||
|
# :offset => @offset,
|
||||||
|
# :limit => @limit)
|
||||||
|
@limit = 10
|
||||||
|
@is_remote = true
|
||||||
|
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||||
@offset ||= @issue_pages.offset
|
@offset ||= @issue_pages.offset
|
||||||
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
@issues = paginateHelper @issues_filter, @limit
|
||||||
:order => 'issues.updated_on desc',
|
# if params[:set_filter]
|
||||||
:offset => @offset,
|
# @set_filter = params[:set_filter]
|
||||||
:limit => @limit)
|
# end
|
||||||
if params[:set_filter]
|
# @issue_count_by_group = @query.issue_count_by_group
|
||||||
@set_filter = params[:set_filter]
|
|
||||||
end
|
|
||||||
@issue_count_by_group = @query.issue_count_by_group
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
||||||
|
|
|
@ -54,7 +54,6 @@ class VersionsController < ApplicationController
|
||||||
@versions = @versions.slice(@offset, @limit)
|
@versions = @versions.slice(@offset, @limit)
|
||||||
#end by young
|
#end by young
|
||||||
|
|
||||||
|
|
||||||
@issues_by_version = {}
|
@issues_by_version = {}
|
||||||
if @selected_tracker_ids.any? && @versions.any?
|
if @selected_tracker_ids.any? && @versions.any?
|
||||||
issues = Issue.visible.all(
|
issues = Issue.visible.all(
|
||||||
|
@ -81,6 +80,14 @@ class VersionsController < ApplicationController
|
||||||
all
|
all
|
||||||
}
|
}
|
||||||
format.api
|
format.api
|
||||||
|
format.xls {
|
||||||
|
@issues = @version.fixed_issues.visible.
|
||||||
|
includes(:status, :tracker, :priority).
|
||||||
|
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
|
||||||
|
all
|
||||||
|
filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls"
|
||||||
|
send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
:year => params[:year], :months => params[:months]},
|
:year => params[:year], :months => params[:months]},
|
||||||
:method => :get, :id => 'query_form') do %>
|
:method => :get, :id => 'query_form') do %>
|
||||||
<%= hidden_field_tag 'set_filter', '1' %>
|
<%= hidden_field_tag 'set_filter', '1' %>
|
||||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
<!--<fieldset id="filters" class="collapsible <%#= @query.new_record? ? "" : "collapsed" %>">-->
|
||||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
<!--<legend onclick="toggleFieldset(this);"><%#= l(:label_filter_plural) %></legend>-->
|
||||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
<!--<div style="<%#= @query.new_record? ? "" : "display: none;" %>">-->
|
||||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
<!--<%#= render :partial => 'queries/filters', :locals => {:query => @query} %>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
</fieldset>
|
<!--</fieldset>-->
|
||||||
<fieldset class="collapsible collapsed">
|
<fieldset class="collapsible collapsed">
|
||||||
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
</script>
|
</script>
|
||||||
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if issues.count == 10%>
|
<div style="text-align:center;">
|
||||||
<%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
<div class="pages" style="width:auto; display:inline-block;">
|
||||||
<% end%>
|
<ul id="issue_list_pagination">
|
||||||
|
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -43,6 +43,30 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点击的时候让过滤条件选中assign_to
|
||||||
|
function switch_assign_to(assign) {
|
||||||
|
var assign = "option[value =" + assign + "]"
|
||||||
|
$("#assignToMe").click(function(){
|
||||||
|
|
||||||
|
});
|
||||||
|
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
|
||||||
|
remote_function();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击的时候让过滤条件选中user_id
|
||||||
|
function createByMe(user_id) {
|
||||||
|
var user = "option[value =" + user_id + "]"
|
||||||
|
$("#createByMe").click(function(){
|
||||||
|
|
||||||
|
});
|
||||||
|
$("select[id='author_id']").find(user).attr("selected", "selected");
|
||||||
|
remote_function();
|
||||||
|
}
|
||||||
|
|
||||||
|
function all_reset_form() {
|
||||||
|
$("#issue_query_form")[0].reset();
|
||||||
|
remote_function();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -92,6 +116,11 @@
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
</div><!--filter_form end-->
|
</div><!--filter_form end-->
|
||||||
|
<a href="javascript:void(0);" onclick="switch_assign_to(<%= User.current.id %>)" id="assignToMe">指派我的</a>
|
||||||
|
<a href="javascript:void(0);" onclick="all_reset_form();">所有的</a>
|
||||||
|
<a href="javascript:void(0);" onclick="createByMe(<%= User.current.id %>)" id="createByMe">我发布的</a>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="fl"> </div>
|
<div class="fl"> </div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -113,6 +142,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||||
|
@ -140,7 +170,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div style="float: left; padding-top: 30px">
|
<div style="float: left; padding-top: 30px">
|
||||||
<%= link_to "导出:XLS", project_issues_path(:project_id => @project, :format => 'xls') %>
|
<%= link_to "导出:Excel", project_issues_path(:project_id => @project, :format => 'xls') %>
|
||||||
<%# other_formats_links do |f| %>
|
<%# other_formats_links do |f| %>
|
||||||
<%#= f.link_to "XLS", :url => params, :remote => false %>
|
<%#= f.link_to "XLS", :url => params, :remote => false %>
|
||||||
<%#= f.link_to 'PDF', :url => params %>
|
<%#= f.link_to 'PDF', :url => params %>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
|
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
|
||||||
<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list,其余的都是替换show_more_issues
|
|
||||||
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query, :issue_pages=> @issue_pages, :issue_count => @issue_count, :project=> @project})%>");
|
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query, :issue_pages=> @issue_pages, :issue_count => @issue_count, :project=> @project})%>");
|
||||||
<%else%>
|
$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||||
$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>");
|
|
||||||
<%end%>
|
|
||||||
|
|
|
@ -95,9 +95,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="div_user_issue_reply_<%=user_activity_id%>">
|
|
||||||
<%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">
|
<div class="homepagePostReplyBannerCount">
|
||||||
<span>回复</span>
|
<span>回复</span>
|
||||||
<span class="reply_iconup" > ︿</span>
|
<span class="reply_iconup" > ︿</span>
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<span class="mr15"><%= count>0 ? "(#{count})" : "" %></span><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -3,14 +3,20 @@
|
||||||
<p class="f14 mb5">»<%= l(:label_versions_progress)%></p>
|
<p class="f14 mb5">»<%= l(:label_versions_progress)%></p>
|
||||||
<%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
<%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||||
<p class="progress-info">
|
<p class="progress-info">
|
||||||
<%= link_to(l(:label_x_issues, :count => version.issues_count),
|
<%#= 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",) %>
|
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),
|
(<%#= 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") %>
|
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),
|
<%#= 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") %>)
|
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>
|
</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="flash error"><%= l(:label_roadmap_no_issues) %></div>
|
<div class="flash error"><%= l(:label_roadmap_no_issues) %></div>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %>
|
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %>
|
||||||
<%=h tracker.name %></label>
|
<%=h tracker.name %></label>
|
||||||
<% end %>
|
<% end %>
|
||||||
<label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label>
|
<!--label for="completed"><%#= check_box_tag "completed", 1, params[:completed] %> <%#= l(:label_show_completed_versions) %></label-->
|
||||||
<% if @project.descendants.active.any? %>
|
<% if @project.descendants.active.any? %>
|
||||||
<%= hidden_field_tag 'with_subprojects', 0 %>
|
<%= hidden_field_tag 'with_subprojects', 0 %>
|
||||||
<label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
|
<label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
|
||||||
|
@ -26,7 +26,8 @@
|
||||||
|
|
||||||
<div class="roadmap_box">
|
<div class="roadmap_box">
|
||||||
<p><a href="javascript:void(0)" class=" f16 fb c_dblue " target="_blank">
|
<p><a href="javascript:void(0)" class=" f16 fb c_dblue " target="_blank">
|
||||||
<%= link_to_version_show version, :name => version_anchor(version) %>
|
<a href="javascript:void(0)" class=" f16 fb c_dblue " target="_blank"><%= version_anchor(version)%></a>
|
||||||
|
<%#= link_to_version_show version, :name => version_anchor(version) %>
|
||||||
<% if version.completed? %>
|
<% if version.completed? %>
|
||||||
<span style="color: #E8770D;float:right;"><%= format_date(version.effective_date) %></span>
|
<span style="color: #E8770D;float:right;"><%= format_date(version.effective_date) %></span>
|
||||||
<% elsif version.effective_date %>
|
<% elsif version.effective_date %>
|
||||||
|
@ -57,10 +58,10 @@
|
||||||
<div class="roadmap_list">
|
<div class="roadmap_list">
|
||||||
<p class="f14 mb5">»<%= l(:label_versions_description)%></p>
|
<p class="f14 mb5">»<%= l(:label_versions_description)%></p>
|
||||||
<p><%=h version.description %></p>
|
<p><%=h version.description %></p>
|
||||||
|
<p class="f14 mb5">»<%= link_to "导出:Excel", version_path(version, :format => 'xls') %></p>
|
||||||
</div><!--roadmap_list end-->
|
</div><!--roadmap_list end-->
|
||||||
</div><!--roadmap_box end-->
|
</div><!--roadmap_box end-->
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul class="wlist" >
|
<ul class="wlist" >
|
||||||
<%= pagination_links_full @versions_pages%>
|
<%= pagination_links_full @versions_pages%>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue