diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index b42b3a942..251f37cdc 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -3,16 +3,11 @@ # Copyright (C) 2013-2014 class StoresController < ApplicationController layout 'base_stores' - # menu_item :overview - # menu_item :roadmap, :only => :roadmap - # menu_item :settings, :only => :settings - # include ActsAsTaggableOn::TagsHelper def search name = params[:name] ||= '' redirect_to stores_path, :notice => l(:field_course_un) if name.blank? # 按文件名搜索 - #result = Attachment.includes(:project).where("projects.is_public = 1 AND filename LIKE '%" << name << "%' ") result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE '%" + name + "%' "). reorder("created_on DESC") result = result.to_a @@ -30,8 +25,6 @@ class StoresController < ApplicationController LIMIT = 12 unless const_defined?(:LIMIT) def index - # @projects_attach = project_classification(0).take(LIMIT) - # @courses_attach = project_classification(1).take(LIMIT) @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1). reorder("#{Attachment.table_name}.downloads DESC"). limit(LIMIT) @@ -62,10 +55,10 @@ class StoresController < ApplicationController limit(LIMIT) doc_attach = join_tools_project Document, project_type issue_attach = join_tools_project Issue, project_type - mess_attach = []#join_tools_project Message, project_type + mess_attach = [] news_attach = join_tools_project News"news", project_type vers_attach = join_tools_project Version"versions", project_type - wiki_attach = []#join_tools_project WikiPage, project_type + wiki_attach = [] tmp = pro_attach+doc_attach+issue_attach+mess_attach+news_attach+vers_attach+wiki_attach tmp.sort { |a, b| b.downloads <=> a.downloads } diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index 0ed270d92..d25f865f1 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -1,22 +1,8 @@ - - <% content_for :top_field do%>
-
- <%= result.filename %>
+
|
+