issue功能优化

This commit is contained in:
daiao 2016-09-27 19:44:24 +08:00
parent 19c1a0d843
commit 7c76584e14
5 changed files with 11 additions and 14 deletions

View File

@ -60,13 +60,13 @@ class IssuesController < ApplicationController
def index def index
if params[:set_filter] != "1" if params[:set_filter] != "1"
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
@issues = @project.issues.visible.all @issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc')
@issue_count = @issues.count @issue_count = @issues_filter.count
@limit = 10 @limit = 10
@is_remote = true @is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset @offset ||= @issue_pages.offset
@issues = paginateHelper @issues, @limit @issues = paginateHelper @issues_filter, @limit
# if params[:set_filter] # if params[:set_filter]
# @set_filter = params[:set_filter] # @set_filter = params[:set_filter]
# end # end

View File

@ -80,14 +80,11 @@ class VersionsController < ApplicationController
all all
} }
format.api format.api
format.xls { # format.xls {
@issues = @version.fixed_issues.visible. # @issues = @version.fixed_issues.visible.includes(:status, :tracker, :priority).reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").all
includes(:status, :tracker, :priority). # filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls"
reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id"). # send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
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

View File

@ -9,7 +9,7 @@
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
div.recall_con{width:570px;} div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} div.recall_con .reply_btn{margin-left:606px;margin-top:5px;}
</style> </style>
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>

View File

@ -40,7 +40,7 @@
<% end %> <% end %>
<li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li> <li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li>
<% if User.current.allowed_to?(:manage_versions, @project) %> <% if User.current.allowed_to?(:manage_versions, @project) %>
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li> <li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);"><%= l(:milestone) %></li>
<% end %> <% end %>
<!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>--> <!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>-->
<% if User.current.allowed_to?(:manage_repository, @project) %> <% if User.current.allowed_to?(:manage_repository, @project) %>

View File

@ -58,7 +58,7 @@
<div class="roadmap_list"> <div class="roadmap_list">
<p class="f14 mb5">&#187;<%= l(:label_versions_description)%></p> <p class="f14 mb5">&#187;<%= l(:label_versions_description)%></p>
<p><%=h version.description %></p> <p><%=h version.description %></p>
<p class="f14 mb5">&#187;<%= link_to "导出Excel", version_path(version, :format => 'xls') %></p> <!--p class="f14 mb5">&#187;<%#= 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 %>