You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/files/create.js.erb

45 lines
2.0 KiB

6 years ago
<% if @addTag%>
<% if @obj_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#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',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$("#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',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_show').html('<%=render_attachments_tag_save(@project, nil)%>');
$('#put-tag-form #name').val("");
//$('#put-tag-form').hide();
<% end %>
<% else %>
$("#attachments_fields").children().remove();
$("#upload_file_count").text("未上传文件");
<% if @project %>
<% if @in_project_toolbar %>
window.location.href = '<%= project_files_path(@project) %>'
<% else %>
$("#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 %>
notice_box_redirect("<%= course_files_path(@course) %>","上传成功");
<% end %>
<% end %>
$(document).ready(img_thumbnails);