Merge branch 'szzh' into develop
This commit is contained in:
commit
85b7a43cb1
|
@ -67,9 +67,7 @@ class FilesController < ApplicationController
|
||||||
end
|
end
|
||||||
sort = "#{@sort} #{@order}"
|
sort = "#{@sort} #{@order}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# show_attachments [@course]
|
# show_attachments [@course]
|
||||||
|
|
||||||
begin
|
begin
|
||||||
q = "%#{params[:name].strip}%"
|
q = "%#{params[:name].strip}%"
|
||||||
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
|
@ -108,14 +106,18 @@ class FilesController < ApplicationController
|
||||||
end
|
end
|
||||||
sort = "#{@sort} #{@order}"
|
sort = "#{@sort} #{@order}"
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
q = "%#{params[:name].strip}%"
|
q = "%#{params[:name].strip}%"
|
||||||
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||||
if params[:insite]
|
if params[:insite]
|
||||||
@result = find_public_attache q,sort
|
if q == "%%"
|
||||||
@result = visable_attachemnts_insite @result,@project
|
@result = []
|
||||||
@searched_attach = paginateHelper @result,10
|
@searched_attach = paginateHelper @result,10
|
||||||
|
else
|
||||||
|
@result = find_public_attache q,sort
|
||||||
|
@result = visable_attachemnts_insite @result,@project
|
||||||
|
@searched_attach = paginateHelper @result,10
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@result = find_project_attache q,@project,sort
|
@result = find_project_attache q,@project,sort
|
||||||
@result = visable_attachemnts @result
|
@result = visable_attachemnts @result
|
||||||
|
|
|
@ -169,7 +169,7 @@ class IssuesController < ApplicationController
|
||||||
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
||||||
redirect_to new_project_issue_url(@issue.project, :issue => attrs)
|
redirect_to new_project_issue_url(@issue.project, :issue => attrs)
|
||||||
else
|
else
|
||||||
redirect_to issue_url(@issue)
|
redirect_to issue_url(@issue.id)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
|
format.api { render :action => 'show', :status => :created, :location => issue_url(@issue) }
|
||||||
|
@ -239,7 +239,8 @@ class IssuesController < ApplicationController
|
||||||
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
|
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_back_or_default issue_path(@issue) }
|
|
||||||
|
format.html { redirect_to issue_url(@issue.id) }
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -622,8 +622,8 @@ module ApplicationHelper
|
||||||
# 公开项目资源可以引用,admin和管理员和资源上传者拥有设置公开私有权限
|
# 公开项目资源可以引用,admin和管理员和资源上传者拥有设置公开私有权限
|
||||||
def authority_pubilic_for_files(project, file)
|
def authority_pubilic_for_files(project, file)
|
||||||
@result = false
|
@result = false
|
||||||
if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id || User.current.admin) &&
|
if (is_project_manager?(User.current.id, @project.id) && User.current.allowed_to?(:manage_files, project)) || file.author_id == User.current.id || User.current.admin &&
|
||||||
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
|
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
|
||||||
@result = true
|
@result = true
|
||||||
end
|
end
|
||||||
return @result
|
return @result
|
||||||
|
|
|
@ -65,6 +65,16 @@ module ProjectsHelper
|
||||||
content_tag('div', content, :class => "tabs")
|
content_tag('div', content, :class => "tabs")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 判断我的项目中是否有重名项目
|
||||||
|
def judge_same_projectname(user, project_name)
|
||||||
|
result = false
|
||||||
|
my_projects = user.projects
|
||||||
|
my_projects.each do |mp|
|
||||||
|
result = true if mp.name == project_name
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
# Added by young
|
# Added by young
|
||||||
def course_settings_tabs
|
def course_settings_tabs
|
||||||
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
|
||||||
|
|
|
@ -277,6 +277,9 @@ module QueriesHelper
|
||||||
elsif(params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='')
|
elsif(params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='')
|
||||||
params[:op][:created_on]='<='
|
params[:op][:created_on]='<='
|
||||||
params[:v][:created_on]=[params[:issue_create_date_end]]
|
params[:v][:created_on]=[params[:issue_create_date_end]]
|
||||||
|
else
|
||||||
|
params[:op][:created_on]='!'
|
||||||
|
params[:v][:created_on]=''
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@query.build_from_params(params)
|
@query.build_from_params(params)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
<% delete_allowed = User.current.allowed_to?(:manage_files, project) %>
|
||||||
<div class="re_con_top">
|
<div class="re_con_top">
|
||||||
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||||
<p class="f_r" style="color: #808080">
|
<p class="f_r" style="color: #808080">
|
||||||
|
@ -22,13 +22,13 @@
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
||||||
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||||
<% else %>
|
<% if authority_pubilic_for_files(project, file) && delete_allowed %>
|
||||||
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
|
||||||
<% end %>
|
|
||||||
<% if authority_pubilic_for_files(project, file) %>
|
|
||||||
<span id="is_public_<%= file.id %>">
|
<span id="is_public_<%= file.id %>">
|
||||||
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
|
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
|
||||||
</span>
|
</span>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,5 @@
|
||||||
<%#= watcher_link_issue(@issue, User.current) %>
|
<%#= watcher_link_issue(@issue, User.current) %>
|
||||||
<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
|
<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
|
||||||
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
|
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
|
||||||
|
<%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
|
||||||
|
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>
|
||||||
<%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
|
|
||||||
<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>
|
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
$("input[nhtype='dateinput']").each(function(){
|
$("input[nhname='nhname']").change(function(){
|
||||||
$(this).attr('readonly',true);
|
if($(this).val()=='创建日期起始' || $(this).val()=='创建日期结束')return;
|
||||||
$(this).datepicker({
|
$("input[nhname='nhname']",$(this).parent('div')).val($(this).val());
|
||||||
dateFormat: 'yy-mm-dd',
|
remote_function();
|
||||||
showButtonPanel: true,showClearButton: true,showTodayButton: true,
|
|
||||||
changeMonth: true,
|
|
||||||
changeYear: true
|
|
||||||
});
|
|
||||||
$(this).change(function(){
|
|
||||||
$("#issue_query_form").submit();
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function remote_function() {
|
function remote_function() {
|
||||||
|
@ -55,10 +48,15 @@
|
||||||
<div class="problem_search" >
|
<div class="problem_search" >
|
||||||
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" value="<%= @subject ? @subject : ""%>" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" value="<%= @subject ? @subject : ""%>" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
|
||||||
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
|
||||||
<!--<a href="javascript:void(0)" class="problem_search_btn fl" onclick="nh_reset_form();" >清空</a>-->
|
<a href="javascript:void(0)" class="grey_btn fl ml10" onclick="nh_reset_form();" >清空</a>
|
||||||
</div><!--problem_search end-->
|
</div><!--problem_search end-->
|
||||||
|
<%= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
|
||||||
|
<p class="problem_p fr" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.visible.all.count %></a>
|
||||||
|
<%= l(:lable_issues_undo) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div id="filter_form" class="fr" >
|
<div class="cl"></div>
|
||||||
|
<div id="filter_form" class="fl">
|
||||||
|
|
||||||
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
|
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
|
||||||
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
|
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
|
||||||
|
@ -85,24 +83,22 @@
|
||||||
)
|
)
|
||||||
%>
|
%>
|
||||||
</div><!--filter_form end-->
|
</div><!--filter_form end-->
|
||||||
|
<div>
|
||||||
|
<div class="fl"> </div>
|
||||||
|
<div>
|
||||||
|
<input name="issue_create_date_start" nhname="date_val" type="hidden"/>
|
||||||
|
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
|
||||||
|
<%= calendar_for('issue_create_date_start_show') %>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;"> - </div>
|
||||||
|
<div>
|
||||||
|
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
|
||||||
|
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%>
|
||||||
|
<%= calendar_for('issue_create_date_end_show') %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<!--<div>-->
|
|
||||||
<!--<div style="float:left;">创建时间 : </div>-->
|
|
||||||
<!--<div>-->
|
|
||||||
<!--<%#= text_field_tag 'issue_create_date_start', '',:readonly=>true, :size=>15, :onchange => "remote_function()",:style=>'float:left;'%>-->
|
|
||||||
<!--<%#= calendar_for('issue_create_date_start') %>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--<div style="float:left;"> - </div>-->
|
|
||||||
<!--<div>-->
|
|
||||||
<!--<%#= text_field_tag 'issue_create_date_end', '',:readonly=>true, :size=>15, :onchange => "remote_function()",:style=>'float:left;'%>-->
|
|
||||||
<!--<%#= calendar_for('issue_create_date_end') %>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--<div class="cl"></div>-->
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<p class="problem_p fl" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.visible.all.count %></a>
|
|
||||||
<%= l(:lable_issues_undo) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -79,20 +79,25 @@
|
||||||
user_ischeck=true;
|
user_ischeck=true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(user_ischeck==false){
|
|
||||||
nh_show_err_message('请选择用户!');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var role_ischeck=false;
|
var role_ischeck=false;
|
||||||
$("input[name='membership[role_ids][]']").each(function(){
|
$("input[name='membership[role_ids][]']").each(function(){
|
||||||
if($(this).prop('checked')){
|
if($(this).prop('checked')){
|
||||||
role_ischeck=true;
|
role_ischeck=true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(user_ischeck==false && role_ischeck==false){
|
||||||
|
nh_show_err_message('请选择用户和角色!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(user_ischeck==false){
|
||||||
|
nh_show_err_message('请选择用户!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(role_ischeck==false){
|
if(role_ischeck==false){
|
||||||
nh_show_err_message('请选择角色!');
|
nh_show_err_message('请选择角色!');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -15,6 +15,11 @@
|
||||||
<p style="padding-left: 180px;"><%= setting_text_field :activity_days_default, :size => 6 %> <%= l(:label_day_plural) %></p>
|
<p style="padding-left: 180px;"><%= setting_text_field :activity_days_default, :size => 6 %> <%= l(:label_day_plural) %></p>
|
||||||
|
|
||||||
<p style="padding-left: 180px;"><%= setting_text_field :host_name, :size => 60 %>
|
<p style="padding-left: 180px;"><%= setting_text_field :host_name, :size => 60 %>
|
||||||
|
<p style="padding-left: 180px;"><%= setting_text_field :host_course, :size => 60 %>
|
||||||
|
<p style="padding-left: 180px;"><%= setting_text_field :host_contest, :size => 60 %>
|
||||||
|
<p style="padding-left: 180px;"><%= setting_text_field :host_user, :size => 60 %>
|
||||||
|
<p style="padding-left: 180px;"><%= setting_text_field :host_repository, :size => 60 %>
|
||||||
|
|
||||||
<em class="info"><%= l(:label_example) %>: <%= @guessed_host_and_path %></em></p>
|
<em class="info"><%= l(:label_example) %>: <%= @guessed_host_and_path %></em></p>
|
||||||
|
|
||||||
<p style="padding-left: 180px;"><%= setting_select :protocol, [['HTTP', 'http'], ['HTTPS', 'https']] %></p>
|
<p style="padding-left: 180px;"><%= setting_select :protocol, [['HTTP', 'http'], ['HTTPS', 'https']] %></p>
|
||||||
|
|
|
@ -183,6 +183,10 @@ en:
|
||||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||||
setting_plain_text_mail: Plain text mail (no HTML)
|
setting_plain_text_mail: Plain text mail (no HTML)
|
||||||
setting_host_name: Host name and path
|
setting_host_name: Host name and path
|
||||||
|
setting_host_course: Host course and path
|
||||||
|
setting_host_contest: Host contest and path
|
||||||
|
setting_host_user: Host user and path
|
||||||
|
setting_host_repository: Host repository and path
|
||||||
setting_text_formatting: Text formatting
|
setting_text_formatting: Text formatting
|
||||||
setting_wiki_compression: Wiki history compression
|
setting_wiki_compression: Wiki history compression
|
||||||
setting_feeds_limit: Maximum number of items in Atom feeds
|
setting_feeds_limit: Maximum number of items in Atom feeds
|
||||||
|
|
|
@ -190,6 +190,10 @@ zh:
|
||||||
setting_bcc_recipients: 使用密件抄送 (bcc)
|
setting_bcc_recipients: 使用密件抄送 (bcc)
|
||||||
setting_plain_text_mail: 纯文本(无HTML)
|
setting_plain_text_mail: 纯文本(无HTML)
|
||||||
setting_host_name: 主机名称
|
setting_host_name: 主机名称
|
||||||
|
setting_host_course: 课程域名
|
||||||
|
setting_host_contest: 竞赛域名
|
||||||
|
setting_host_user: 用户域名
|
||||||
|
setting_host_repository: 仓库域名
|
||||||
setting_text_formatting: 文本格式
|
setting_text_formatting: 文本格式
|
||||||
setting_wiki_compression: 压缩Wiki历史文档
|
setting_wiki_compression: 压缩Wiki历史文档
|
||||||
setting_feeds_limit: RSS Feed内容条数限制
|
setting_feeds_limit: RSS Feed内容条数限制
|
||||||
|
|
|
@ -425,4 +425,35 @@ $(function(){
|
||||||
|
|
||||||
personalized_init();
|
personalized_init();
|
||||||
});
|
});
|
||||||
//cookie记忆html区块 显示/隐藏 的代码 end
|
//cookie记忆html区块 显示/隐藏 的代码 end
|
||||||
|
|
||||||
|
// 新建项目的时候判断是否与我已有的项目重复
|
||||||
|
function judgeprojectname(){
|
||||||
|
$('#new_project').validate({
|
||||||
|
errorPlacement: function(error, element){
|
||||||
|
alert('error')
|
||||||
|
},
|
||||||
|
success: function(label){
|
||||||
|
alert('ok')
|
||||||
|
},
|
||||||
|
onkeyup: false,
|
||||||
|
rules : {
|
||||||
|
name:{required : true,
|
||||||
|
remote : {
|
||||||
|
url : 'projects/judge_same_projectname',
|
||||||
|
type:'get',
|
||||||
|
dataType:'text',
|
||||||
|
data:{
|
||||||
|
name : function(){ return $.trim( $("#name").val() ); }
|
||||||
|
},
|
||||||
|
dataFilter:function( data ){
|
||||||
|
if( data=='true')return false; else return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages : {
|
||||||
|
name:{required : "请填写项目名称!",remote:'您已新建过同名项目,请修改项目名称!'}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue