From 5cc31fb51130fe36a1decea007e9e774e99684dd Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 25 Mar 2016 12:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90=E6=A0=8F?= =?UTF-8?q?=E7=9B=AE=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=B8=A6=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=EF=BC=8C=E5=A6=82tag=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E3=80=81=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_org_order_filter.html.erb | 9 +++++++++ app/views/files/_subfield_files.html.erb | 12 ++---------- app/views/files/search_files_in_subfield.js.erb | 2 ++ .../files/search_org_subfield_tag_attachment.js.erb | 4 +++- public/javascripts/des_kindEditor.js | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 app/views/files/_org_order_filter.html.erb diff --git a/app/views/files/_org_order_filter.html.erb b/app/views/files/_org_order_filter.html.erb new file mode 100644 index 000000000..7fcf115f8 --- /dev/null +++ b/app/views/files/_org_order_filter.html.erb @@ -0,0 +1,9 @@ +<% if @order == "asc" %> + 按 <%= link_to "时间",params.merge(:sort => "created_on:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /  + <%= link_to "下载次数",params.merge(:sort => "downloads:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /  + <%= link_to "引用次数",params.merge(:sort => "quotes:desc", :order => order,:tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序 +<% else %> + 按 <%= link_to "时间",params.merge(:sort => "created_on:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /  + <%= link_to "下载次数",params.merge(:sort => "downloads:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>  /  + <%= link_to "引用次数",params.merge(:sort =>"quotes:asc", :order => order, :tag_name => tag_name,:name => search_name),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序 +<% end %> \ No newline at end of file diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index 9e0dd41d0..516e42c68 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -56,16 +56,8 @@

共有 <%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %> 个资源

-

- <% if @order == "asc" %> - 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /  - <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %> /  - <%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序 - <% else %> - 按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /  - <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>  /  - <%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %> 排序 - <% end %> +

+ <%= render :partial => 'files/org_order_filter', :locals => {:order => @order, :sort => @sort, :tag_name => @tag_name, :search_name => nil} %>

diff --git a/app/views/files/search_files_in_subfield.js.erb b/app/views/files/search_files_in_subfield.js.erb index 77c364817..f1056debd 100644 --- a/app/views/files/search_files_in_subfield.js.erb +++ b/app/views/files/search_files_in_subfield.js.erb @@ -5,4 +5,6 @@ $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>"); $("#attachment_count").html("<%= @result.count %>"); + $("#org_sort").html("<%= escape_javascript(render :partial => 'org_order_filter', + :locals => {:sort => @sort, :order => @order, :tag_name => @tag_name, :search_name => @q}) %>"); <% end %> \ No newline at end of file diff --git a/app/views/files/search_org_subfield_tag_attachment.js.erb b/app/views/files/search_org_subfield_tag_attachment.js.erb index fe4aed937..775fd24a4 100644 --- a/app/views/files/search_org_subfield_tag_attachment.js.erb +++ b/app/views/files/search_org_subfield_tag_attachment.js.erb @@ -1,3 +1,5 @@ $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>"); -$("#attachment_count").html("<%= @result.count %>"); \ No newline at end of file +$("#attachment_count").html("<%= @result.count %>"); +$("#org_sort").html("<%= escape_javascript(render :partial => 'org_order_filter', + :locals => {:sort => @sort, :order => @order, :tag_name => @tag_name,:search_name => @q}) %>"); \ No newline at end of file diff --git a/public/javascripts/des_kindEditor.js b/public/javascripts/des_kindEditor.js index 7c2f1c0cf..126d2a334 100644 --- a/public/javascripts/des_kindEditor.js +++ b/public/javascripts/des_kindEditor.js @@ -54,7 +54,7 @@ function nh_check_field(params){ params.content.sync(); if(params.content.isEmpty()){ - params.contentmsg.html('内容不能为空'); + params.contentmsg.html('请输入文章描述'); params.contentmsg.css({color:'#ff0000'}); }else{ params.contentmsg.html('填写正确');