diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 66e3d6e05..671ebb702 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -93,7 +93,10 @@ class OrganizationsController < ApplicationController end # 热门项目 if @organization.org_subfields.where(:field_type => "Comppro", :hide => 0).count > 0 - @excellent_projects = Project.where(:is_public => true, :status => true, :hot => true) + # @excellent_projects = Project.where(:is_public => true, :status => true, :hot => true).order("project_score") + @excellent_projects = Project.find_by_sql("SELECT p.* FROM `projects` p, project_scores ps where p.id = ps.project_id and p.is_public =1 and + status =1 and hot =1 order by (ps.issue_num * 4 + ps.issue_journal_num + ps.changeset_num * 4 + ps.board_num * 2 + + ps.board_message_num + ps.news_num + ps.attach_num * 5) desc limit 5;") end # 最新动态, 来自我关联的项目和课程 if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 42a033bee..3aa7d8a4a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3103,9 +3103,10 @@ def named_attachment_url_without_domain(id, filename, option={}) attachment_id = (Attachment === id ? id.id : id) Setting.protocol + "://" + Setting.host_name + "/attachments/" + attachment_id.to_s + "/" + filename end + #判断是否为默认的组织栏目 def is_default_field? field - (field.name == 'activity' || field.name == 'course' || field.name == 'project' || field.name == "Comppro" || field.name == "Comppro" || field.name == "Compact") && field.field_type == 'default' + (field.name == 'activity' || field.name == 'course' || field.name == 'project' ) && field.field_type == 'default' end def host_with_protocol diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index a5a3d6aaa..fe27083a0 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -105,10 +105,6 @@ module OrganizationsHelper #排列下拉框 def subfield_status_option type = [] - option1 = [] - option1 << "左一" - option1 << "1" - type << option1 option2 = [] option2 << "左二" option2 << "2" @@ -117,18 +113,6 @@ module OrganizationsHelper option3 << "左三" option3 << "2" type << option3 - option4 = [] - option4 << "右一" - option4 << "3" - type << option4 - option5 = [] - option5 << "右二" - option5 << "5" - type << option5 - option6 = [] - option6 << "右三" - option6 << "6" - type << option6 type end diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 9307f3eb0..fd648cc29 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -57,7 +57,7 @@
  • 新增
  • - <% if field.field_type == "Resource" || field.field_type == "Comptec" %> + <% if field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact" || field.field_type == "Compstu" %> 默认 <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>