完成项目资源库tag云的查询统计
This commit is contained in:
parent
d0a8b4bc18
commit
972f2bfea8
|
@ -449,8 +449,6 @@ class FilesController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# TODO: 临时用 nyan
|
||||
sort_init 'created_on', 'desc'
|
||||
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
|
||||
|
@ -459,13 +457,10 @@ class FilesController < ApplicationController
|
|||
'downloads' => "#{Attachment.table_name}.downloads"
|
||||
|
||||
@containers = [Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
|
||||
|
||||
show_attachments @containers
|
||||
@tag_list = attachment_tag_list @all_attachments
|
||||
|
||||
@attachtype = 0
|
||||
@contenttype = 0
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {
|
||||
|
@ -763,21 +758,33 @@ class FilesController < ApplicationController
|
|||
end
|
||||
|
||||
q = "%#{@q.strip}%"
|
||||
if @project
|
||||
@result = find_project_attache q, @project,sort
|
||||
else
|
||||
@result = find_course_attache q,@course,sort
|
||||
end
|
||||
@result = visable_attachemnts @result
|
||||
if params[:other]
|
||||
if @project
|
||||
@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?('课件') &&
|
||||
!attachment.tag_list.include?('软件') &&
|
||||
!attachment.tag_list.include?('媒体') &&
|
||||
!attachment.tag_list.include?('代码') &&
|
||||
!attachment.tag_list.include?('论文') }
|
||||
end
|
||||
else
|
||||
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank?
|
||||
end
|
||||
@searched_attach = paginateHelper @result,10
|
||||
if @project
|
||||
@tag_list = get_project_tag_list @project
|
||||
@result_search_project = @result
|
||||
else
|
||||
@tag_list = get_course_tag_list @course
|
||||
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
# format.html
|
||||
|
|
|
@ -15,29 +15,6 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
function show_upload(obj)
|
||||
{
|
||||
switch(obj)
|
||||
{
|
||||
case 1:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => @project,:project_attachment_type => 1}) %>');
|
||||
break;
|
||||
case 2:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => @project,:project_attachment_type => 2}) %>');
|
||||
break;
|
||||
case 3:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => @project,:project_attachment_type => 3}) %>');
|
||||
break;
|
||||
default:
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => @project,:project_attachment_type => 5}) %>');
|
||||
}
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
<% if @course %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
|
||||
$("#attachment_count").html("<%= @result.count%>")
|
||||
<% else %>
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'project_list',:locals => {project:@project, all_attachments:@result_search_project, sort:@sort, order:@order, project_attachments:@searched_attach}) %>");
|
||||
$("#attachment_count").html("<%= @result_search_project.count%>")
|
||||
<% end %>
|
||||
|
|
|
@ -1140,3 +1140,8 @@ a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px; te
|
|||
a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
|
||||
a.postOptionLink2 {color:#616060; display:block; width:35px; padding:0px 15px;}
|
||||
a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
|
||||
|
||||
/*tag云*/
|
||||
a.files_tag_icon{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;margin-bottom:10px; }
|
||||
span.files_tag_icon{ width: auto;background: #E1ECF4;color: #39739D;padding: 2px 5px;float: left;margin-right: 10px;margin-bottom: 10px;cursor: pointer; }
|
||||
a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 1px; float:left; margin-right:10px;margin-bottom:10px;}/* padding:1px 10px;*/
|
||||
|
|
Loading…
Reference in New Issue