From 2c7ef034cb65ca52efc817c96c187a8ef6dbb340 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 31 Dec 2015 12:27:31 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=9B=B4=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 2 +-
app/views/files/_course_list.html.erb | 24 ++++++++++---------
.../users/_resource_share_for_orgs.html.erb | 2 +-
..._resource_share_for_project_popup.html.erb | 2 +-
.../users/_resource_share_popup.html.erb | 2 +-
5 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 86d4d3b52..36093f33b 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -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")
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index 310313c59..08e23fb19 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -37,11 +37,12 @@
-
-
- <% 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" %>
+
- <% 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" %>
- <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
- <%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
<% 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 %>
+
- <% end %>
- <%else %>
- <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
- <% end %>
-
- <% end %>
-
+ <% end %>
+ <%else%>
+
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+
+ <% end %>
+ <% end %>
diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb
index 08405a347..9da439c8e 100644
--- a/app/views/users/_resource_share_for_orgs.html.erb
+++ b/app/views/users/_resource_share_for_orgs.html.erb
@@ -1,4 +1,4 @@
-
+
发送到