From e35d2daa0a745dd7a5456ab45c14edb6d23e04f2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 28 Dec 2015 16:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 11 +- .../attachments/update_file_dense.js.erb | 9 +- app/views/files/_course_file.html.erb | 57 +++++----- app/views/files/_course_list.html.erb | 102 +++++++++--------- app/views/files/_tag_yun.html.erb | 4 +- app/views/files/index.html.erb | 16 ++- app/views/files/index.js.erb | 4 + app/views/files/search.js.erb | 7 +- app/views/files/search_tag_attachment.js.erb | 3 +- public/stylesheets/courses.css | 14 ++- 10 files changed, 137 insertions(+), 90 deletions(-) create mode 100644 app/views/files/index.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 121cd3a42..5cbf1ab2f 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -745,7 +745,16 @@ class FilesController < ApplicationController q = "%#{@q.strip}%" @result = find_course_attache q,@course,sort @result = visable_attachemnts @result - @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank? + if params[:other] + @result = @result.select{|attachment| + !attachment.tag_list.include?('课件') && + !attachment.tag_list.include?('软件') && + !attachment.tag_list.include?('媒体') && + !attachment.tag_list.include?('代码') && + !attachment.tag_list.include?('论文') } + else + @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank? + end @searched_attach = paginateHelper @result,10 @tag_list = get_course_tag_list @course diff --git a/app/views/attachments/update_file_dense.js.erb b/app/views/attachments/update_file_dense.js.erb index d99481d08..110d3fc7c 100644 --- a/app/views/attachments/update_file_dense.js.erb +++ b/app/views/attachments/update_file_dense.js.erb @@ -1,2 +1,7 @@ -$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), - :remote=>true,:class=>"f_l re_open",:method => :post) %>"); +$("#is_public_<%= @attachment.id %>").html("<%= escape_javascript(link_to (@attachment.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>@attachment.id,:newtype=>(@attachment.is_public? ? 0:1)), + :remote=>true,:class=>"postOptionLink",:method => :post) %>"); +<%if @attachment.is_public? %> + $("#image_private_<%= @attachment.id%>").html('') +<%else%> +$("#image_private_<%= @attachment.id%>").html('私有') +<%end%> \ No newline at end of file diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index b3371eefe..9513baab0 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -2,7 +2,7 @@ diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 3d1ded552..f9c6c1666 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -8,12 +8,12 @@ <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>(<%= v%>) + <%= k%> x<%= v%> <% else%> <%= k%>(<%= v%>) + ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%> x<%= v%> <% end%> <% end%> <% end%> \ No newline at end of file diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 8b199ab4e..98c1cb684 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -1,12 +1,18 @@ -
+ <% if @container_type == 0 %> - <%= render :partial => 'project_file_new', locals: {project: @project} %> +
+ <%= render :partial => 'project_file_new', locals: {project: @project} %> +
<% elsif @container_type == 1 %> - <%= render :partial => 'course_file', locals: {course: @course} %> +
+ <%= render :partial => 'course_file', locals: {course: @course} %> +
<% elsif @container_type == 2 %> - <%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %> +
+ <%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %> +
<% end %> -
+