项目资源库,上传资源类型,创建资源

This commit is contained in:
huang 2016-01-07 14:47:47 +08:00
parent 972f2bfea8
commit 8f7d5c8a35
5 changed files with 9 additions and 13 deletions

View File

@ -419,8 +419,8 @@ class FilesController < ApplicationController
#modify by nwb
if @project
@addTag=false
if params[:in_course_toolbar]
@in_course_toolbar = params[:in_course_toolbar]
if params[:in_project_toolbar]
@in_project_toolbar = params[:in_project_toolbar]
end
# 发送邮件
attachments = Attachment.attach_filesex(@project, params[:attachments], params[:attachment_type])

View File

@ -64,13 +64,10 @@
<%= submit_tag "项目内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()", :style =>"width:72px;" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<!--REDO: 权限测试-->
<% if (@project.publish_resource==1 && User.current.member_of?(@project) ) %>
<% if @project.publish_resource == 1 && User.current.member_of?(@project) %>
<input class="blueBtn fr mr5" value="上传资源" onclick="project_files_upload();">
<% end %>
<% end %>
<!-- show_window('light','fade','20%','35%')-->
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
</div>
<div>
<div class="fileTagWrap" id="files_tag">

View File

@ -1,4 +1,3 @@
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
<div class="upload_con">
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2>

View File

@ -6,8 +6,8 @@
<%= error_messages_for 'attachment' %>
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<input type="hidden" name="in_course_toolbar" value="Y">
<%= form_tag(project_files_path(project), :multipart => true, :remote => !ie8?, :name=>"upload_form") do %>
<input type="hidden" name="in_project_toolbar" value="Y">
<!--<p class="c_grey fr mt10 mr5">-->
<div class="c_dark">
<input name="project_attachment_type[]" type="checkbox" value="1" checked class="c_dblue">软件版本</input>&nbsp;<span class="c_grey">|</span>&nbsp;
@ -25,7 +25,7 @@
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
<%= submit_tag '确定',:onclick=>'submit_resource();',:onfocus=>'this.blur()',:id=>'submit_resource',:class=>'sendSourceText fr' %>
<%= submit_tag '确定',:onclick=>'submit_resource();', :onfocus=>'this.blur()', :id=>'submit_resource', :class=>'sendSourceText fr' %>
<% end %>
</div>

View File

@ -23,9 +23,9 @@ $("#upload_file_count").text("未上传文件");
$('#upload_file_div').slideToggle('slow');
<% if @project %>
hideModal();
<%if @in_project_toolbar%>
window.location.href = '<%= project_files_path(@project)%>'
<%else%>
<% 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 %>");