组织资源栏目排序,带过滤条件,如tag类型、搜索条件等

This commit is contained in:
ouyangxuhua 2016-03-25 12:30:33 +08:00
parent 2d4f5284df
commit 5cc31fb511
5 changed files with 17 additions and 12 deletions

View File

@ -0,0 +1,9 @@
<% if @order == "asc" %>
按&nbsp;<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp;排序
<% else %>
按&nbsp;<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp; /&nbsp;
<%= 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"} %>&nbsp;排序
<% end %>

View File

@ -56,16 +56,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %></span>&nbsp;个资源</p> <p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080"> <p class="f_r" style="color: #808080" id="org_sort">
<% if @order == "asc" %> <%= render :partial => 'files/org_order_filter', :locals => {:order => @order, :sort => @sort, :tag_name => @tag_name, :search_name => nil} %>
按&nbsp;<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp;排序
<% else %>
按&nbsp;<%= 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"} %>&nbsp;/&nbsp;
<%= 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"} %>&nbsp; /&nbsp;
<%= 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"} %>&nbsp;排序
<% end %>
</p> </p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -5,4 +5,6 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', $("#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})%>"); :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
$("#attachment_count").html("<%= @result.count %>"); $("#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 %> <% end %>

View File

@ -1,3 +1,5 @@
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list', $("#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})%>"); :locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
$("#attachment_count").html("<%= @result.count %>"); $("#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}) %>");

View File

@ -54,7 +54,7 @@ function nh_check_field(params){
params.content.sync(); params.content.sync();
if(params.content.isEmpty()){ if(params.content.isEmpty()){
params.contentmsg.html('内容不能为空'); params.contentmsg.html('请输入文章描述');
params.contentmsg.css({color:'#ff0000'}); params.contentmsg.css({color:'#ff0000'});
}else{ }else{
params.contentmsg.html('填写正确'); params.contentmsg.html('填写正确');