项目隐藏 项目讨论区发送中去掉课程
This commit is contained in:
parent
9b14b86b64
commit
52a8a64a69
|
@ -2152,6 +2152,7 @@ class UsersController < ApplicationController
|
|||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_ids = params[:checkbox1] || params[:send_ids]
|
||||
@hidden_unproject = hidden_unproject_infos
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -2171,6 +2172,7 @@ class UsersController < ApplicationController
|
|||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
|
||||
@hidden_unproject = hidden_unproject_infos
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -3334,6 +3336,7 @@ class UsersController < ApplicationController
|
|||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_ids = params[:checkbox1] || params[:send_ids]
|
||||
@hidden_unproject = hidden_unproject_infos
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
<% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %>
|
||||
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% if hidden_unproject_infos %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% else %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% end %>
|
||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||
<% if project.is_public? %>
|
||||
<li>
|
||||
|
@ -20,7 +24,11 @@
|
|||
<% end %>
|
||||
<% else %>
|
||||
<ul class="resourceSendO">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% if hidden_unproject_infos %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% else %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send_hidden('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<% if @hidden_unproject %>
|
||||
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
<% else %>
|
||||
<select class="resourcesSendType" onclick="chooseSendType2hidden('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
|
||||
<option value="1">项目</option>
|
||||
<option value="2">组织</option>
|
||||
</select>
|
||||
<% end %>
|
|
@ -1153,6 +1153,31 @@ function show_send(id, user_id, send_type){
|
|||
}
|
||||
}
|
||||
|
||||
//为了隐藏非项目功能
|
||||
//var sendType = '1';
|
||||
var lastSendType ;//初始为发送到我的项目
|
||||
function show_send_hidden(id, user_id, send_type){
|
||||
if (lastSendType === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/search_user_project',
|
||||
data:{send_id:id, send_type:send_type}
|
||||
});
|
||||
}else if( lastSendType == '2'){//组织
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/search_user_org',
|
||||
data:{send_id:id, send_type:send_type}
|
||||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/search_user_project',
|
||||
data:{send_id:id, send_type:send_type}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//id 发送的id
|
||||
//发送的id数组
|
||||
//send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻
|
||||
|
@ -1216,6 +1241,30 @@ function chooseSendType2(res_id,res_ids, user_id, send_type, type){
|
|||
lastSendType = sendType;
|
||||
}
|
||||
|
||||
//隐藏项目其它信息特用
|
||||
function chooseSendType2hidden(res_id,res_ids, user_id, send_type, type){
|
||||
console.log(res_ids);
|
||||
sendType = $(".resourcesSendType").val();
|
||||
if (sendType === lastSendType) {
|
||||
return;
|
||||
} else if(lastSendType != null) { //不是第一次点击的时候
|
||||
if (sendType == '1') {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/search_user_project' + '?' + "&type=" + type,
|
||||
data:{send_id:res_id, send_ids:res_ids ,send_type:send_type}
|
||||
});
|
||||
}else if(sendType == '2'){
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/users/' + user_id + '/search_user_org' + '?' + "&type=" + type,
|
||||
data:{send_id:res_id, send_ids:res_ids, send_type:send_type}
|
||||
});
|
||||
}
|
||||
}
|
||||
lastSendType = sendType;
|
||||
}
|
||||
|
||||
//组织新建和配置中,选择组织为私有后,disbled掉允许游客下载选项
|
||||
function disable_down(source, des, hint){
|
||||
if (source.attr("checked")){
|
||||
|
|
Loading…
Reference in New Issue