diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index d38c68c2a..159648f34 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -25,8 +25,6 @@ class OrgSubfieldsController < ApplicationController # status类型说明,详见SubField def update_status_by_type subfield, type case type - when "activity" - subfield.update_attribute(:status, 0) when "Resource" subfield.update_attribute(:status, 6) when "Comptec" diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index fe27083a0..aaaf05d21 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -102,6 +102,19 @@ module OrganizationsHelper end end + def org_time_by_type obj + case obj.act_type + when "Message" + time = obj.act.updated_on + when "News" + user = obj.act.created_on + when "HomeworkCommon" + user = obj.act.updated_at + when "Issue" + user = obj.act.updated_on + end + end + #排列下拉框 def subfield_status_option type = [] diff --git a/app/models/organization.rb b/app/models/organization.rb index 7aa259528..50f62ea11 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -18,9 +18,9 @@ class Organization < ActiveRecord::Base end def add_default_subfields - OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1) - OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2) - OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3) + OrgSubfield.create(:organization_id => self.id, :name => 'activity', :field_type => 'default', :priority => 1, :status => 0) + OrgSubfield.create(:organization_id => self.id, :name => 'course', :field_type => 'default', :priority => 2, :status => 2) + OrgSubfield.create(:organization_id => self.id, :name => 'project', :field_type => 'default', :priority => 3, :status => 2) end def switch_type diff --git a/app/views/layouts/base_org_custom.html.erb b/app/views/layouts/base_org_custom.html.erb index 0eb764e5e..bfa76a221 100644 --- a/app/views/layouts/base_org_custom.html.erb +++ b/app/views/layouts/base_org_custom.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'org_custom', 'new_user', 'public','jquery/jquery-ui-1.9.2' %> + <%= stylesheet_link_tag 'new_user', 'public', 'org_custom','jquery/jquery-ui-1.9.2' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> diff --git a/app/views/organizations/_org_custom_right1.html.erb b/app/views/organizations/_org_custom_right1.html.erb index bd7c8b89e..192c7bb64 100644 --- a/app/views/organizations/_org_custom_right1.html.erb +++ b/app/views/organizations/_org_custom_right1.html.erb @@ -8,23 +8,24 @@ <% user = org_user_by_type(obj) %> <% title = org_title_by_type(obj) %> <% content = org_content_by_type(obj) %> + <% time = org_time_by_type(obj) %>
  • <%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %>

    <%= link_to user.show_name, user_path(user), :class => "por_hot_name link-blue fl", :target => "_blank" %>  :  - <% if obj.act_type = "Message" %> + <% if obj.act_type == "Message" %> <%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %> - <% elsif obj.act_type = "News" %> + <% elsif obj.act_type == "News" %> <%= link_to title, news_path(obj.act.id) %> - <% elsif obj.act_type = "HomeworkCommon" %> + <% elsif obj.act_type == "HomeworkCommon" %> <%= link_to title, student_work_index_url_in_org(obj.act.id) %> - <% elsif obj.act_type = "Issue" %> + <% elsif obj.act_type == "Issue" %> <%= link_to title, issue_path(obj.act.id) %> <% end %>

    -

    <%= time_from_now(obj.act.created_on) %> +

    <%= time_from_now(time) %>

    diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index fd648cc29..684a917a1 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -23,7 +23,7 @@
  • <%= name %>
  • 默认
  • - <% if field.name == "activity" %> + <% if field.name == "activity" || field.name == "course" || field.name == "project" %> 默认 <% 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 %>