diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 496c3aa92..159648f34 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -25,16 +25,18 @@ class OrgSubfieldsController < ApplicationController # status类型说明,详见SubField def update_status_by_type subfield, type case type + when "Resource" + subfield.update_attribute(:status, 6) when "Comptec" subfield.update_attribute(:status, 6) when "Compstu" subfield.update_attribute(:status, 7) when "Comppro" - subfield.update_attribute(:status, 8) + subfield.update_attribute(:status, 5) when "Compcou" - subfield.update_attribute(:status, 9) + subfield.update_attribute(:status, 2) when "Compact" - subfield.update_attribute(:status, 10) + subfield.update_attribute(:status, 4) end end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 4021560bf..8be34a318 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -93,7 +93,7 @@ class OrganizationsController < ApplicationController end # 热门项目 if @organization.org_subfields.where(:field_type => "Comppro", :hide => 0).count > 0 - @excellent_courses = Course.where(:is_public => true, :status => true) + @excellent_projects = Course.where(:is_public => true, :status => true, :hot => true) 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 a2285a678..42a033bee 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3105,7 +3105,7 @@ def named_attachment_url_without_domain(id, filename, option={}) end #判断是否为默认的组织栏目 def is_default_field? field - (field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default' + (field.name == 'activity' || field.name == 'course' || field.name == 'project' || field.name == "Comppro" || field.name == "Comppro" || field.name == "Compact") && field.field_type == 'default' end def host_with_protocol diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4c6089b51..a5a3d6aaa 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -66,11 +66,40 @@ module OrganizationsHelper def org_user_by_type obj case obj.act_type when "Message" + user = obj.act.author when "News" + user = obj.act.author when "HomeworkCommon" + user = obj.act.user when "Issue" + user = obj.act.author end + end + def org_title_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject + when "News" + user = obj.act.title + when "HomeworkCommon" + user = obj.act.name + when "Issue" + user = obj.act.subject + end + end + + def org_content_by_type obj + case obj.act_type + when "Message" + user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content + when "News" + user = obj.act.description + when "HomeworkCommon" + user = obj.act.description + when "Issue" + user = obj.act.description + end end #排列下拉框 diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb index fc556255a..6368fef90 100644 --- a/app/views/organizations/_org_custom_header.html.erb +++ b/app/views/organizations/_org_custom_header.html.erb @@ -38,14 +38,9 @@ <%= link_to "首页", organization_path(@organization), :class => "por_index_act" %> <% when 'course' %> -
- <%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name fl", :target => "_blank" %> - : - <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 28, :maxwidth => 0, :cl => ""} %> -
-<%= time_from_now(message.created_on) %> - -
-+ <%= link_to user.show_name, user_path(user), :class => "por_hot_name fl", :target => "_blank" %> + : + <% if obj.act_type = "Message" %> + <%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %> + <% elsif obj.act_type = "News" %> + <%= link_to title, news_path(obj.act.id) %> + <% elsif obj.act_type = "HomeworkCommon" %> + <%= link_to title, student_work_index_url_in_org(obj.act.id) %> + <% elsif obj.act_type = "Issue" %> + <%= link_to title, issue_path(obj.act.id) %> + <% end %> +
+<%= time_from_now(obj.act.created_on) %> + +
+活跃度500
+该模块暂时没有相关内容
+ <% else %> + <% container = cotainers.first %> +众所周知,系统读取数据时,从内存中读取要比从硬盘上速度要快好几上速度要快好几百倍。故现在绝大上速度要快好几百倍。故现在绝大百倍。故现在绝大部分应用系...
- -活跃度500
- -活跃度500
- -活跃度500
- -活跃度500
- -<%= content.to_s.html_safe%> -
-<% else %> -- - <%= content.to_s.html_safe%> - -
-<% end %> + +