资源库更改
This commit is contained in:
parent
b059ab2428
commit
2c7ef034cb
|
@ -202,7 +202,7 @@ class AttachmentsController < ApplicationController
|
|||
Attachment.transaction do
|
||||
@old_attachment = Attachment.find params[:old_attachment_id]
|
||||
#取出当前上传的文件
|
||||
@attachment = Attachment.find(params[:attachments]['1'][:attachment_id])
|
||||
@attachment = Attachment.find(params[:attachments ].first[1][:attachment_id])
|
||||
#将需要修改的记录保存到历史记录
|
||||
@history = AttachmentHistory.new
|
||||
@history.attributes = @old_attachment.attributes.dup.except("id")
|
||||
|
|
|
@ -37,11 +37,12 @@
|
|||
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<% if User.current.logged? %>
|
||||
<% if User.current.logged? %>
|
||||
|
||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
|
||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||
<% if @course.is_public? %>
|
||||
|
@ -55,14 +56,15 @@
|
|||
<%= link_to( '删除资源', attachment_path(file),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<% end %>
|
||||
<%else %>
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<%else%>
|
||||
<ul class="resourceSendO">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="mt10">
|
||||
<div >
|
||||
<div class="relateText fl mb10 mr5">发送到</div>
|
||||
<div class="resourcesSendTo mr15">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="boxContainer">
|
||||
<div>
|
||||
<div class="sendText fl">将资源发送到</div>
|
||||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
|
||||
<option value="1">课程</option>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="boxContainer">
|
||||
<div>
|
||||
<div class="sendText fl">将资源发送至</div>
|
||||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>');">
|
||||
<option value="1">课程</option>
|
||||
|
|
Loading…
Reference in New Issue