模式二中添加课程定配

This commit is contained in:
huang 2016-06-02 21:32:56 +08:00
parent e2848f4dec
commit 257165dbaf
4 changed files with 14 additions and 5 deletions

View File

@ -32,11 +32,11 @@ class OrgSubfieldsController < ApplicationController
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

View File

@ -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

View File

@ -119,6 +119,15 @@
<% end %>
<% end %>
<% end %>
<% when 'Compcou' %>
<% @excellent_courses.first(4).each do |course| %>
<div class="por_course_bar fl clear">
<%= link_to course.name, course_path(course.id), :target => '_blank', :class => "por_course_title", :title => course.name %>
<%= link_to image_tag(url_to_avatar(course),:width => "140", :height => "100"), user_path(attach.author), :target => "_blank", :class => "fl" %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => course.id, :content=> course.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now course.updated_at %></a>
</div>
<% end %>
<% end %>
<% else %>
<% if field.field_type == "Post" %>

View File

@ -15,7 +15,7 @@
<% if field.status.to_i == 4 %>
<%= render :partial => 'organizations/org_custom_right1', :locals => {:field => field} %>
<% elsif field.status.to_i == 5 %>
<%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field} %>
<%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field, :containers => @excellent_projects} %>
<% elsif field.status.to_i == 6 %>
<%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %>
<% end %>