课程资源库添加资源提示及

rep_quality
huang 9 years ago
parent fa25a78f62
commit 2e36cf6d6a

@ -213,9 +213,9 @@ class AttachmentsController < ApplicationController
def tip_attachment_update
if params[:course_id]
@tip_all_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id])
@tip_all_public_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id], :is_public => 1)
@tip_all_private_attachments = Attachment.where(:container_type => "Course", :container_id => params[:project_id], :is_public => 0)
@tip_all_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id])
@tip_all_public_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 1)
@tip_all_private_attachments = Attachment.where(:container_type => "Course", :container_id => params[:course_id], :is_public => 0)
@course = Course.find(params[:course_id])
elsif params[:project_id]
@tip_all_attachments = Attachment.where(:container_type => "Project", :container_id => params[:project_id])

@ -71,9 +71,9 @@
<li>
<span id="is_public_<%= file.id %>">
<% if params[:tag_name].blank? %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :course_id => course.id), :remote=>true,:class=>"postOptionLink",:method => :post %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :course_id => @course.id), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% else %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :course_id => course.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %>
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid => file.id, :newtype=>(file.is_public? ? 0:1), :tag_name => params[:tag_name].force_encoding("UTF-8"), :course_id => @course.id, :other => params[:other]), :remote=>true,:class=>"postOptionLink",:method => :post %>
<% end %>
</span>
</li>

Loading…
Cancel
Save