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'
|
||||
|
||||
if @query.valid?
|
||||
case params[:format]
|
||||
when 'csv', 'pdf'
|
||||
@limit = 10#Setting.issues_export_limit.to_i
|
||||
when 'atom'
|
||||
@limit = 10#Setting.feeds_limit.to_i
|
||||
when 'xml', 'json'
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
else
|
||||
@limit = 10#per_page_option
|
||||
end
|
||||
# case params[:format]
|
||||
# when 'csv', 'pdf'
|
||||
# @limit = 10#Setting.issues_export_limit.to_i
|
||||
# when 'atom'
|
||||
# @limit = 10#Setting.feeds_limit.to_i
|
||||
# when 'xml', 'json'
|
||||
# @offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
# else
|
||||
# @limit = 10#per_page_option
|
||||
# end
|
||||
@assign_to_id = params[:assigned_to_id]
|
||||
@author_id = params[:author_id]
|
||||
@priority_id = params[:priority_id]
|
||||
|
@ -83,17 +83,23 @@ class IssuesController < ApplicationController
|
|||
@subject = params[:subject]
|
||||
@done_ratio = params[:done_ratio]
|
||||
@issue_count = @query.issue_count
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
||||
# @issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
# 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
|
||||
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
||||
:order => 'issues.updated_on desc',
|
||||
:offset => @offset,
|
||||
:limit => @limit)
|
||||
if params[:set_filter]
|
||||
@set_filter = params[:set_filter]
|
||||
end
|
||||
@issue_count_by_group = @query.issue_count_by_group
|
||||
@issues = paginateHelper @issues_filter, @limit
|
||||
# if params[:set_filter]
|
||||
# @set_filter = params[:set_filter]
|
||||
# end
|
||||
# @issue_count_by_group = @query.issue_count_by_group
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
||||
|
|
|
@ -53,7 +53,6 @@ class VersionsController < ApplicationController
|
|||
@offset ||= @versions_pages.offset
|
||||
@versions = @versions.slice(@offset, @limit)
|
||||
#end by young
|
||||
|
||||
|
||||
@issues_by_version = {}
|
||||
if @selected_tracker_ids.any? && @versions.any?
|
||||
|
@ -81,6 +80,14 @@ class VersionsController < ApplicationController
|
|||
all
|
||||
}
|
||||
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
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
:year => params[:year], :months => params[:months]},
|
||||
:method => :get, :id => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!--<fieldset id="filters" class="collapsible <%#= @query.new_record? ? "" : "collapsed" %>">-->
|
||||
<!--<legend onclick="toggleFieldset(this);"><%#= l(:label_filter_plural) %></legend>-->
|
||||
<!--<div style="<%#= @query.new_record? ? "" : "display: none;" %>">-->
|
||||
<!--<%#= render :partial => 'queries/filters', :locals => {:query => @query} %>-->
|
||||
<!--</div>-->
|
||||
<!--</fieldset>-->
|
||||
<fieldset class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
||||
<div style="display: none;">
|
||||
|
|
|
@ -6,6 +6,11 @@
|
|||
</script>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
||||
<% end %>
|
||||
<% if issues.count == 10%>
|
||||
<%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end%>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<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>
|
||||
|
@ -92,6 +116,11 @@
|
|||
)
|
||||
%>
|
||||
</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 class="fl"> </div>
|
||||
<div>
|
||||
|
@ -113,6 +142,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="contextual">
|
||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||
|
@ -140,7 +170,7 @@
|
|||
<% end %>
|
||||
|
||||
<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| %>
|
||||
<%#= f.link_to "XLS", :url => params, :remote => false %>
|
||||
<%#= 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})%>");
|
||||
<% 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})%>");
|
||||
<%else%>
|
||||
$("#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%>
|
||||
$("#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_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
|
||||
|
||||
|
|
|
@ -95,9 +95,7 @@
|
|||
</div>
|
||||
<div class="cl"></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>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="homepagePostReplyBannerCount">
|
||||
<span>回复</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 %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
</span>
|
||||
|
|
|
@ -3,14 +3,20 @@
|
|||
<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),
|
||||
<%#= 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),
|
||||
(<%#= 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") %>)
|
||||
<%#= 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>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %>
|
||||
<%=h tracker.name %></label>
|
||||
<% 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? %>
|
||||
<%= hidden_field_tag 'with_subprojects', 0 %>
|
||||
<label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label>
|
||||
|
@ -26,7 +26,8 @@
|
|||
|
||||
<div class="roadmap_box">
|
||||
<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? %>
|
||||
<span style="color: #E8770D;float:right;"><%= format_date(version.effective_date) %></span>
|
||||
<% elsif version.effective_date %>
|
||||
|
@ -57,10 +58,10 @@
|
|||
<div class="roadmap_list">
|
||||
<p class="f14 mb5">»<%= l(:label_versions_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_box end-->
|
||||
<% end %>
|
||||
|
||||
<ul class="wlist" >
|
||||
<%= pagination_links_full @versions_pages%>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue