socialforge/app/views/files/create.js.erb

76 lines
3.2 KiB
Plaintext
Raw Normal View History

<% if @addTag%>
2016-04-01 00:27:34 +08:00
<% if @obj_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
2014-06-04 14:13:26 +08:00
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
2016-04-01 00:27:34 +08:00
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
2014-06-04 14:13:26 +08:00
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
2016-04-01 00:27:34 +08:00
$("#put-tag-form- <%=@obj.class%>- <%=@obj.id%>").hide();
$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val("");
<% else %>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
2014-06-04 14:13:26 +08:00
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
2016-04-01 00:27:34 +08:00
$('#tags_show').html('<%=render_attachments_tag_save(@project, nil)%>');
$('#put-tag-form #name').val("");
//$('#put-tag-form').hide();
<% end %>
<% else %>
2014-06-04 14:13:26 +08:00
$("#attachments_fields").children().remove();
$("#upload_file_count").text("未上传文件");
$('#upload_file_div').slideToggle('slow');
2016-04-01 00:27:34 +08:00
<% if @project %>
hideModal();
<% if @in_project_toolbar %>
window.location.href = '<%= project_files_path(@project) %>'
<% else %>
2016-04-01 00:27:34 +08:00
$("#resource_list").html('<%= j(render partial:"project_file", locals: {project: @project}) %>');
$("#project_files_count_info").html("<%= @all_attachments.count %>");
$("#project_files_count_nav").html("(<%= @all_attachments.count %>)")
// 添加文件上传成功提示
<% unless params[:attachments].nil? %>
var div = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
$("#course_list").prepend(div);
setTimeout( function(){div.remove();},3000)
<% end %>
<% end %>
<%elsif @course%>
hideModal();
<%if @in_course_toolbar %>
window.location.href='<%= course_files_path(@course)%>'
<%else%>
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
$("#courses_files_count_info").html("<%= @all_attachments.count%>");
$("#courses_files_count_nav").html("(<%= @all_attachments.count%>)")
// 添加文件上传成功提示,
<% unless params[:attachments].nil? %>
var div = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
$("#course_list").prepend(div);
setTimeout( function(){div.remove();},3000)
<% end %>
<%end%>
<% elsif @org_subfield %>
<% if params[:in_org] %>
window.location.href = '<%= org_subfield_files_path @org_subfield %>';
<%else %>
hideModal();
$("#resource_list").html('<%= j(render partial: "subfield_files" ,locals: {org_subfield: @org_subfield}) %>');
// 添加文件上传成功提示,
<% unless params[:attachments].nil? %>
// var div = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
// $("#org_subfield_list").prepend(div);
// setTimeout( function(){div.remove();},3000);
<% end %>
<% end %>
<% elsif @organization %> //组织单独处理
hideModal();
2016-04-01 20:10:28 +08:00
window.location.href = '<%= organization_path @organization %>';
2016-04-01 00:27:34 +08:00
<% end %>
2014-06-04 14:13:26 +08:00
<% end %>
$(document).ready(img_thumbnails);
2014-06-04 14:13:26 +08:00