Merge branch 'rep_quality' into develop
This commit is contained in:
commit
c76cfad51a
|
@ -58,57 +58,15 @@ class IssuesController < ApplicationController
|
|||
include ApplicationHelper
|
||||
|
||||
def index
|
||||
retrieve_query
|
||||
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
|
||||
sort_update(@query.sortable_columns)
|
||||
@query.sort_criteria = sort_criteria.to_a
|
||||
|
||||
@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
|
||||
@tracker_id = params[:tracker_id]
|
||||
@assign_to_id = params[:assigned_to_id]
|
||||
@author_id = params[:author_id]
|
||||
@status_id = params[:status_id]
|
||||
@subject = params[:subject]
|
||||
@done_ratio = params[:done_ratio]
|
||||
@fixed_version_id = params[:fixed_version_id]
|
||||
@issue_count = @query.issue_count
|
||||
@test = params[:test]
|
||||
# @issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
# params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
||||
# @offset ||= @issue_pages.offset
|
||||
@project_sort = 'issues.updated_on desc'
|
||||
if params[:test] != "0"
|
||||
case @test
|
||||
when "1"
|
||||
@project_sort = 'issues.created_on desc'
|
||||
when "2"
|
||||
@project_sort = 'issues.created_on asc'
|
||||
when "3"
|
||||
@project_sort = 'issues.updated_on desc'
|
||||
when "4"
|
||||
@project_sort = 'issues.updated_on asc'
|
||||
end
|
||||
end
|
||||
@issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count
|
||||
@issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count
|
||||
@issues_filter = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], :order => @project_sort)
|
||||
if params[:set_filter] != "1"
|
||||
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
|
||||
@issues = @project.issues.visible.all
|
||||
@issue_count = @issues.count
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||
@offset ||= @issue_pages.offset
|
||||
@issues = paginateHelper @issues_filter, @limit
|
||||
@issues = paginateHelper @issues, @limit
|
||||
# if params[:set_filter]
|
||||
# @set_filter = params[:set_filter]
|
||||
# end
|
||||
|
@ -118,21 +76,106 @@ class IssuesController < ApplicationController
|
|||
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
||||
format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
|
||||
# format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json}
|
||||
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
|
||||
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
|
||||
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
|
||||
# format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
|
||||
# format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
|
||||
# format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
|
||||
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
|
||||
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young
|
||||
format.any(:atom, :csv, :pdf) { render(:nothing => true) }
|
||||
format.api { render_validation_errors(@query) }
|
||||
format.js
|
||||
retrieve_query
|
||||
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
|
||||
sort_update(@query.sortable_columns)
|
||||
@query.sort_criteria = sort_criteria.to_a
|
||||
|
||||
@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
|
||||
@tracker_id = params[:tracker_id]
|
||||
@assign_to_id = params[:assigned_to_id]
|
||||
@author_id = params[:author_id]
|
||||
@status_id = params[:status_id]
|
||||
@subject = params[:subject]
|
||||
@done_ratio = params[:done_ratio]
|
||||
@fixed_version_id = params[:fixed_version_id]
|
||||
@issue_count = @query.issue_count
|
||||
@test = params[:test]
|
||||
# @issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
# params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1
|
||||
# @offset ||= @issue_pages.offset
|
||||
@project_sort = 'issues.updated_on desc'
|
||||
if params[:test] != "0"
|
||||
case @test
|
||||
when "1"
|
||||
@project_sort = 'issues.created_on desc'
|
||||
when "2"
|
||||
@project_sort = 'issues.created_on asc'
|
||||
when "3"
|
||||
@project_sort = 'issues.updated_on desc'
|
||||
when "4"
|
||||
@project_sort = 'issues.updated_on asc'
|
||||
end
|
||||
end
|
||||
@issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count
|
||||
@issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count
|
||||
@issues_filter = @query.issues(:order => @project_sort)
|
||||
@limit = 10
|
||||
@is_remote = true
|
||||
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
|
||||
@offset ||= @issue_pages.offset
|
||||
@issues = paginateHelper @issues_filter, @limit
|
||||
# if params[:set_filter]
|
||||
# @set_filter = params[:set_filter]
|
||||
# end
|
||||
# @issue_count_by_group = @query.issue_count_by_group
|
||||
if params[:export_issue_hidden] == "1"
|
||||
# index(:format=>'xls', :export_issue_hidden => 0)
|
||||
params[:export_issue_hidden] = "0"
|
||||
redirect_to project_issues_path(:project_id => @project, :format => 'xls')
|
||||
|
||||
# respond_to do |format|
|
||||
# format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
|
||||
# send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
# return
|
||||
# }
|
||||
# return
|
||||
# end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
||||
format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
|
||||
# format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json}
|
||||
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
|
||||
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
|
||||
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
|
||||
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
|
||||
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { render(:template => 'issues/index', :layout => @project_base_tag) }#by young
|
||||
format.any(:atom, :csv, :pdf) { render(:nothing => true) }
|
||||
format.api { render_validation_errors(@query) }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
|
|
|
@ -77,7 +77,7 @@ class RepositoriesController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}_#{@rev}_#{l(:label_rep_xls)}.xls"
|
||||
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
|
||||
send_data(export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
|
|
|
@ -68,29 +68,31 @@ module ApplicationHelper
|
|||
g = Gitlab.client
|
||||
cycle = params[:cycle]
|
||||
rev = params[:rev]
|
||||
# branch = g.branche(gpid, rev)
|
||||
statics = g.rep_stats(gpid, :rev => rev)
|
||||
|
||||
if cycle == "week"
|
||||
statics = g.rep_stats_week(gpid, :rev => rev)
|
||||
elsif cycle == "month"
|
||||
statics = g.rep_stats_month(gpid, :rev => rev)
|
||||
end
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "版本库"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_author_mail),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle)])
|
||||
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])
|
||||
count_row = 1
|
||||
statics.each do |static|
|
||||
user = User.where(:mail => static.email).first
|
||||
sheet1[count_row,0] = rev
|
||||
sheet1[count_row,1] = user.nil? ? static.uname : user.show_name
|
||||
sheet1[count_row,2] = static.email
|
||||
sheet1[count_row,2] = static.commits_num
|
||||
sheet1[count_row,3] = static.add
|
||||
sheet1[count_row,4] = static.del
|
||||
sheet1[count_row,5] = static.changes
|
||||
sheet1[count_row,6] = Time.now
|
||||
sheet1[count_row,7] = "1周"
|
||||
sheet1[count_row,6] = Time.now.strftime('%Y-%m-%d %H:%M:%S')
|
||||
sheet1[count_row,7] = cycle == "week" ? "最近1周" : "最近一月"
|
||||
sheet1[count_row,8] = static.email
|
||||
count_row += 1
|
||||
end
|
||||
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
end
|
||||
|
@ -102,21 +104,21 @@ module ApplicationHelper
|
|||
sheet1 = book.create_worksheet :name => "issues"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:issue_xls_version),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
|
||||
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
|
||||
count_row = 1
|
||||
issues.each do |issue|
|
||||
sheet1[count_row,0] = issue.id
|
||||
sheet1[count_row,1] = issue_tracker_change(issue.tracker_id)
|
||||
sheet1[count_row,2] = issue.subject
|
||||
sheet1[count_row,3] = issue.description
|
||||
sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe
|
||||
sheet1[count_row,4] = issue_status_change(issue.status_id)
|
||||
sheet1[count_row,5] = issue.assigned_to.try(:show_name)
|
||||
sheet1[count_row,6] = issue_priority_change(issue.priority_id)
|
||||
sheet1[count_row,7] = issue.author.show_name
|
||||
sheet1[count_row,8] = issue.created_on
|
||||
sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S')
|
||||
sheet1[count_row,9] = issue.fixed_version.try(:name)
|
||||
sheet1[count_row,10] = issue.start_date
|
||||
sheet1[count_row,11] = issue.due_date
|
||||
sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d')
|
||||
sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d')
|
||||
sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id)
|
||||
count_row += 1
|
||||
end
|
||||
|
@ -1863,6 +1865,10 @@ module ApplicationHelper
|
|||
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => "BlueCirBtnMini ml10",:style => "display:inline-block; height:20px; line-height:20px;"))
|
||||
end
|
||||
|
||||
def link_to_function_none(name, function, html_options={})
|
||||
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:style => "display:inline-block; height:20px; line-height:20px;"))
|
||||
end
|
||||
|
||||
# Helper to render JSON in views
|
||||
def raw_json(arg)
|
||||
arg.to_json.to_s.gsub('/', '\/').html_safe
|
||||
|
@ -1882,8 +1888,8 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def check_all_links(form_name)
|
||||
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + " ".html_safe + " | "+ " ".html_safe +
|
||||
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
|
||||
link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + " ".html_safe + " | "+ " ".html_safe +
|
||||
link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
|
||||
end
|
||||
|
||||
# 本次修改,修改为只显示关闭的所占%比
|
||||
|
|
|
@ -48,10 +48,10 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
|
||||
<p class="contextual">
|
||||
<%= gantt_zoom_link(@gantt, :in) %>
|
||||
<%= gantt_zoom_link(@gantt, :out) %>
|
||||
</p>
|
||||
<!--<p class="contextual">-->
|
||||
<!--<%#= gantt_zoom_link(@gantt, :in) %>-->
|
||||
<!--<%#= gantt_zoom_link(@gantt, :out) %>-->
|
||||
<!--</p>-->
|
||||
|
||||
<p class="buttons">
|
||||
<%= text_field_tag 'months', @gantt.months, :size => 2 %>
|
||||
|
@ -99,9 +99,9 @@
|
|||
t_height = g_height + headers_height
|
||||
%>
|
||||
|
||||
<% if @gantt.truncated %>
|
||||
<p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
|
||||
<% end %>
|
||||
<%# if @gantt.truncated %>
|
||||
<!--<p class="warning"><%#= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>-->
|
||||
<%# end %>
|
||||
|
||||
<table style="width:100%; border:0; border-collapse: collapse;">
|
||||
<tr>
|
||||
|
@ -294,10 +294,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'PDF', :url => params.merge(@gantt.params) %>
|
||||
<%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %>
|
||||
<% end %>
|
||||
|
||||
<% end # query.valid? %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<div class="cl"></div>
|
||||
<li>
|
||||
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
|
||||
<label class="label"><%= l(:field_fixed_version) %>:</label>
|
||||
<label class="label"><%= l(:milestone) %>:</label>
|
||||
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
|
||||
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
|
||||
:class => "w150" %>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
|
||||
<li><p class="label03" > 目标版本 : </p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
|
||||
<li><p class="label03" > <%=l(:milestone)%> : </p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_is_private_tips)%></label>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<input type="checkbox" class="ml30">
|
||||
<label class="fl ml5 mt3">不需要评审</label>
|
||||
</li>
|
||||
<!--<li>-->
|
||||
<!--<input type="checkbox" class="ml30">-->
|
||||
<!--<label class="fl ml5 mt3">不需要评审</label>-->
|
||||
<!--</li>-->
|
||||
<div class="cl"></div>
|
||||
<!--<li>-->
|
||||
<!--<%# if @issue.safe_attribute? 'project_id' %>-->
|
||||
|
|
|
@ -40,16 +40,23 @@
|
|||
周报
|
||||
<% end %>
|
||||
</li>
|
||||
<!--li class="c_grey">
|
||||
<#% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%#= link_to activity.try(:author), user_path(activity.author_id), :class => "c_grey" %>
|
||||
<#% else %>
|
||||
<%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "c_grey" %>
|
||||
<%# end %>
|
||||
</li-->
|
||||
<li class="c_grey">
|
||||
<% unless activity.assigned_to_id.nil? %>
|
||||
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "c_grey" %>
|
||||
<% if activity.try(:assigned_to).try(:realname).empty? %>
|
||||
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id), :class => "c_grey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "c_grey" %>
|
||||
<% end %>
|
||||
<% end %></li>
|
||||
<li class="c_grey" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
|
||||
<li class="issues_list_min c_grey"><%= activity.status.name%></li>
|
||||
<li class="c_grey" style="width: 60px; padding-right: 10px" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
|
||||
<li class="issues_list_min c_grey" ><%= activity.status.name%></li>
|
||||
<li class="<%=(activity.done_ratio == 100 ? 'c_red' : 'c_green') %>"><%= activity.done_ratio %>%</li>
|
||||
<li class="issues_list_min">
|
||||
<%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<%= import_ke(enable_at: true,init_activity: true) %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
<script xmlns="http://www.w3.org/1999/html">
|
||||
//issues列表
|
||||
function g(o){
|
||||
/*function g(o){
|
||||
return document.getElementById(o);
|
||||
}
|
||||
function HoverLi(n){
|
||||
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
|
||||
g('issues_list_nav_'+n).className='issues_nav_hover';
|
||||
}
|
||||
}*/
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
|
@ -43,12 +43,21 @@
|
|||
// }
|
||||
// });
|
||||
}
|
||||
function nh_reset_form() {
|
||||
$("#issue_query_form")[0].reset();
|
||||
$("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦
|
||||
remote_function();
|
||||
|
||||
function remote_function_export() {
|
||||
$("#export_issue_hidden").attr("value","1");
|
||||
// $("#issue_query_form").attr("format","xls");
|
||||
$("#issue_query_form").submit();
|
||||
// $("#issue_query_form").removeAttr("format");
|
||||
$("#export_issue_hidden").attr("value","0");
|
||||
}
|
||||
|
||||
// function nh_reset_form() {
|
||||
// $("#issue_query_form")[0].reset();
|
||||
// $("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦
|
||||
// remote_function();
|
||||
// }
|
||||
|
||||
function EnterPress(e){
|
||||
var e = e || window.event;
|
||||
if(e.keyCode == 13){
|
||||
|
@ -58,28 +67,30 @@
|
|||
|
||||
// 点击的时候让过滤条件选中assign_to
|
||||
function switch_assign_to(assign) {
|
||||
var assign = "option[value =" + assign + "]"
|
||||
var assign = "option[value =" + assign + "]";
|
||||
$("#issues_type_2").click(function(){
|
||||
|
||||
});
|
||||
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
|
||||
$("select[id='author_id']").val('');
|
||||
remote_function();
|
||||
}
|
||||
|
||||
// 点击的时候让过滤条件选中user_id
|
||||
function createByMe(user_id) {
|
||||
var user = "option[value =" + 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();
|
||||
$("select[id='author_id']").val('');
|
||||
$("select[id='assigned_to_id']").val('');
|
||||
$("input[nhname='date_val']").val('');
|
||||
remote_function();
|
||||
}
|
||||
</script>
|
||||
|
@ -90,22 +101,25 @@
|
|||
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fl mr10">新 增</a>
|
||||
<div class="issues_statistics fl">
|
||||
<ul>
|
||||
<li>所有<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.project_score.issue_num %></a></li>
|
||||
<li>开启<a href="javascript:void(0);" class="issues_greycirbg_btn "><%#= @issues_filter_assign_count %><%= @project.issues.where('status_id in (1,2,3,4,6)').visible.all.count %></a></li>
|
||||
<li>关闭<a href="javascript:void(0);" class="issues_greycirbg_btn "><%#= @issues_filter_author_count %><%= @project.issues.where(:status_id => 5 ).visible.all.count %></a></li>
|
||||
<li>所有<a class="issues_greycirbg_btn "><%= @project.project_score.issue_num %></a></li>
|
||||
<li>开启<a class="issues_greycirbg_btn "><%#= @issues_filter_assign_count %><%= @project.issues.where('status_id in (1,2,3,4,6)').visible.all.count %></a></li>
|
||||
<li>关闭<a class="issues_greycirbg_btn "><%#= @issues_filter_author_count %><%= @project.issues.where(:status_id => 5 ).visible.all.count %></a></li>
|
||||
</ul>
|
||||
</div><!--issues_statistics end-->
|
||||
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue fr" alt="导出EXCEL">导出EXCEL</a>
|
||||
<!--<input type="button" class="hw_btn_blue fr" value="导出EXCEL" onclick="remote_function_export()">-->
|
||||
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls', :export => true, :set_filter => "1")%>" class="hw_btn_blue fr" alt="导出EXCEL" onclick="remote_function_export()">导出EXCEL</a>
|
||||
</div>
|
||||
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
|
||||
<%= hidden_field_tag 'set_filter', '1' %>
|
||||
<%= hidden_field_tag 'export_issue_hidden', '0' %>
|
||||
<!--<input id="exprot_issues_hidden" value="0" type="hidden">-->
|
||||
<div class="clear mb10">
|
||||
<div class="hw_search_box fl ">
|
||||
<input class="hw_search-input" placeholder="请输入问题名称" type="text" id="v_subject" name="subject" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
||||
<a href="javascript:void(0);" class="hw_btn_search" onclick="remote_function();" ></a>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="HoverLi(1);all_reset_form();">清除</a>
|
||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="all_reset_form();">清除</a>
|
||||
|
||||
<div class="calendar_div fr">
|
||||
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
|
||||
|
@ -123,19 +137,19 @@
|
|||
|
||||
<div class="issues_con_list" style="position: relative;">
|
||||
<ul id="issues_list_nav" >
|
||||
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);all_reset_form();">
|
||||
<li id="issues_list_nav_1" onclick="HoverLi(1);all_reset_form();">
|
||||
<a href="javascript:void(0);" onclick="all_reset_form();" id="issues_type_1" >所有<span class="issues_nav_tag ml5"><%= @project.project_score.issue_num %></span></a>
|
||||
</li>
|
||||
<li id="issues_list_nav_2" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0);" onclick="switch_assign_to(<%= User.current.id %>)" id="issues_type_2" >指派给我
|
||||
<span id="issue_assigned_count"><%= render :partial => "issues/issue_filter" %></span>
|
||||
<!--li id="issues_list_nav_2" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0);" onclick="switch_assign_to(<%#= User.current.id %>)" id="issues_type_2" >指派给我
|
||||
<span id="issue_assigned_count"><%#= render :partial => "issues/issue_filter" %></span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="issues_list_nav_3" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0);" onclick="createByMe(<%= User.current.id %>)" id="issues_type_3" >我的发布
|
||||
<span id="issue_author_count"><%= render :partial => "issues/issue_filter_author" %></span>
|
||||
<a href="javascript:void(0);" onclick="createByMe(<%#= User.current.id %>)" id="issues_type_3" >我的发布
|
||||
<span id="issue_author_count"><%#= render :partial => "issues/issue_filter_author" %></span>
|
||||
</a>
|
||||
</li>
|
||||
</li-->
|
||||
<div class="cl"></div>
|
||||
|
||||
|
||||
|
@ -149,6 +163,12 @@
|
|||
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
|
||||
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
|
||||
|
||||
<%#= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
|
||||
{ :include_blank => false,:selected=>@author_id ? @author_id : 0},
|
||||
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"fl "}
|
||||
)
|
||||
%>
|
||||
|
||||
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
|
||||
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
|
||||
},
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @project %>
|
||||
<div class="sy_class_id fl"><p><%= l(:label_project_ivite_code)%><br /><span class="sy_corange"><%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %></span></p></div>
|
||||
<div class="sy_class_info fl ml15">
|
||||
<div class="sy_class_titbox clear">
|
||||
|
@ -34,8 +35,8 @@
|
|||
<% end %>
|
||||
</span>
|
||||
<span class=" mr15">浏览:<a class="sy_corange"><%= @project.visits.to_i %></a></span>
|
||||
<span class=" mr15"><%= l(:label_user_watcher) %>: <%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
|
||||
<span class=" mr15"><%= l(:label_member) %>: <%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
|
||||
<span class=" mr15">关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
|
||||
<span class=" mr15">成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
|
||||
</p>
|
||||
<div class="mt15 clear" id="join_exit_project_div">
|
||||
<%= render 'layouts/join_exit_project' %>
|
||||
|
|
|
@ -49,8 +49,7 @@
|
|||
<div id="content">
|
||||
<%= render :partial => 'layouts/base_project_top' %>
|
||||
<div id="LSide" class="fl">
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @project %>
|
||||
|
||||
<!--邀请加入-->
|
||||
<div class="subNavBoxProject">
|
||||
<div id="project_memu_list">
|
||||
|
|
|
@ -7,7 +7,7 @@ if($("#course_avatar_form").length > 0) {
|
|||
window.location.href = "<%=settings_course_path(@course) %>";
|
||||
}
|
||||
<% elsif @project %>
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
|
||||
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:110px;height:110px;overflow:hidden",:alt=>"项目logo") %>');
|
||||
if($("#project_avatar_form").length > 0) {
|
||||
window.location.href = "<%=settings_project_path(@project) %>";
|
||||
}
|
||||
|
|
|
@ -79,8 +79,9 @@
|
|||
|
||||
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
|
||||
<div class="fr">
|
||||
<%= link_to "代码统计:导出excel", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev } %></br>
|
||||
|
||||
<a style="color: #7f7f7f;">导出统计结果:</a>
|
||||
<%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" } %> <a style="color: #7f7f7f;">|</a>
|
||||
<%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" } %>
|
||||
</div>
|
||||
|
||||
<%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %>
|
||||
|
@ -94,4 +95,4 @@
|
|||
|
||||
<script>
|
||||
$("#RSide").css("width","730px");
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
<span class="proInfoP" style="width:100px;"><span><%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %></span></span> </li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<p class="label03"> 目标版本 : </p>
|
||||
<p class="label03"> <%=l(:milestone)%> : </p>
|
||||
<span class="proInfoP" style="width:100px;"><%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %> </span> </li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
|
|
@ -48,7 +48,7 @@ zh:
|
|||
# 左边栏
|
||||
#
|
||||
label_project_id: "项目ID:"
|
||||
label_project_ivite_code: "邀请码:"
|
||||
label_project_ivite_code: "邀请码"
|
||||
|
||||
label_agree_join_project: 同意加入
|
||||
label_apply_project: "+加入"
|
||||
|
@ -222,11 +222,12 @@ zh:
|
|||
rep_branch: 分支
|
||||
rep_author: 作者
|
||||
rep_author_mail: 邮箱
|
||||
rep_changeset: 提交次数
|
||||
rep_code_add: 添加行数
|
||||
rep_code_delete: 删除代码
|
||||
rep_code_modified: 总行数
|
||||
rep_sode_time: 导出时间
|
||||
rep_sode_cycle: 周期
|
||||
rep_sode_cycle: 时间区间
|
||||
|
||||
# 自定义查询
|
||||
label_query_plural: 自定义查询
|
||||
|
@ -236,6 +237,7 @@ zh:
|
|||
# 自定义查询> 过滤器类别
|
||||
field_status: 状态
|
||||
field_fixed_version: 目标版本
|
||||
milestone: 里程碑
|
||||
field_assigned_to_role: 角色的成员
|
||||
field_category: 类别
|
||||
field_created_on: 创建于
|
||||
|
|
|
@ -117,6 +117,16 @@ class Gitlab::Client
|
|||
end
|
||||
alias_method :repo_rep_stats, :rep_stats
|
||||
|
||||
def rep_stats_week(project, options={})
|
||||
get("/projects/#{project}/repository/rep_stats_week", :query => options)
|
||||
end
|
||||
alias_method :repo_rep_stats, :rep_stats
|
||||
|
||||
def rep_stats_month(project, options={})
|
||||
get("/projects/#{project}/repository/rep_stats_month", :query => options)
|
||||
end
|
||||
alias_method :repo_rep_stats, :rep_stats
|
||||
|
||||
def rep_user_stats(project, options={})
|
||||
get("/projects/#{project}/repository/rep_user_stats", :query => options)
|
||||
end
|
||||
|
|
|
@ -187,13 +187,13 @@ Redmine::AccessControl.map do |map|
|
|||
map.permission :delete_issue_watchers, {:watchers => :destroy}
|
||||
end
|
||||
|
||||
map.project_module :time_tracking do |map|
|
||||
map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin
|
||||
map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true
|
||||
map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member
|
||||
map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin
|
||||
map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member
|
||||
end
|
||||
# map.project_module :time_tracking do |map|
|
||||
# map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin
|
||||
# map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true
|
||||
# map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member
|
||||
# map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin
|
||||
# map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member
|
||||
# end
|
||||
|
||||
map.project_module :news do |map|
|
||||
map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member
|
||||
|
@ -207,12 +207,12 @@ Redmine::AccessControl.map do |map|
|
|||
map.permission :notificationcomment_contestnotifications, {:notificationcomments => :create},:belong_to_contest => true
|
||||
end
|
||||
|
||||
map.project_module :documents do |map|
|
||||
map.permission :add_documents, {:documents => [:new, :create, :add_attachment]}, :require => :loggedin
|
||||
map.permission :edit_documents, {:documents => [:edit, :update, :add_attachment]}, :require => :loggedin
|
||||
map.permission :delete_documents, {:documents => [:destroy]}, :require => :loggedin
|
||||
map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true
|
||||
end
|
||||
# map.project_module :documents do |map|
|
||||
# map.permission :add_documents, {:documents => [:new, :create, :add_attachment]}, :require => :loggedin
|
||||
# map.permission :edit_documents, {:documents => [:edit, :update, :add_attachment]}, :require => :loggedin
|
||||
# map.permission :delete_documents, {:documents => [:destroy]}, :require => :loggedin
|
||||
# map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true
|
||||
# end
|
||||
|
||||
map.project_module :files do |map|
|
||||
map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin
|
||||
|
|
|
@ -793,9 +793,10 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;}
|
|||
.issues_form_filter select{ width:84px; height:35px; font-size:14px; border:1px solid #c8c8c8; border-right:none; background-color:#fff; margin-bottom: 10px; color: #888;}
|
||||
.issues_form_filter input{ height:33px;width:91px; border:1px solid #c8c8c8;background-color:#fff;}
|
||||
.issues_form_filter select:focus,.issues_form_filter input:focus{border:1px solid #c8c8c8; border-right:none;}
|
||||
.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;}
|
||||
.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("/images/project/arrow.png") no-repeat scroll right center transparent;}
|
||||
.issues_form_filter select:focus {outline:none; border:none;}
|
||||
input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;}
|
||||
.issues_data_img{ display:block; width:25px; height:33px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; }
|
||||
.issues_data_img{ display:block; width:25px; height:33px; border:1px solid #c8c8c8; border-left:none; background: url("/images/public_icon.png") -29px 9px no-repeat; }
|
||||
/* 缺陷Tab */
|
||||
.issues_con_list{border:1px solid #c8c8c8; }
|
||||
#issues_list_nav {border-bottom:1px solid #d0d0d0;}
|
||||
|
|
Loading…
Reference in New Issue