+ <% if field.status == 0 %>
-
-
-
- <% unless @course_acts_homework.nil? %>
- -
- <% @course_acts_homework.each do |act| %>
- <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :course_activity => 0} %>
- <% end %>
-
- <% end %>
+ 课程动态
+ <% if @course_acts.nil? %>
+ 暂无内容,敬请期待!
+ <% else %>
+
+
+ <% unless @course_acts_homework.nil? %>
+ -
+ <% @course_acts_homework.each do |act| %>
+ <%= render :partial => 'org_new_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :course_activity => 0} %>
+ <% end %>
+
+ <% end %>
<% unless @course_acts_message.nil? %>
- -
- <% @course_acts_message.each do |act| %>
- <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id), :user_activity_id =>act.id} %>
- <% end %>
-
- <% end %>
- <% unless @course_acts_news.nil? %>
- -
- <% @course_acts_news.each do |act| %>
- <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id), :user_activity_id =>act.id} %>
- <% end %>
-
- <% end %>
+ -
+ <% @course_acts_message.each do |act| %>
+ <%= render :partial => 'org_new_course_message', :locals => {:activity => Message.find(act.org_act_id), :user_activity_id =>act.id} %>
+ <% end %>
+
+ <% end %>
+ <% unless @course_acts_news.nil? %>
+ -
+ <% @course_acts_news.each do |act| %>
+ <%= render :partial => 'org_new_course_news', :locals => {:activity => News.find(act.org_act_id), :user_activity_id =>act.id} %>
+ <% end %>
+
+ <% end %>
+
+
+
-
-
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+ <% end %>
+ <% else %>
+
+
课程动态
+ <% if @course_acts.nil? %>
+
暂无内容,敬请期待!
+ <% else %>
+
+ <%= render :partial => 'organizations/org_new_course_act_list', :locals =>{:activities => @course_acts, :field => field, :organization => @organization} %>
+
+
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+ <% end %>
+
+
+
+ <% end %>
-
-
-
- <% unless @project_message_acts.nil? %>
-
-
- <% @project_message_acts.each do |act| %>
- <%= render :partial => 'organizations/org_new_project_message', :locals => {:activity => Message.find(act.org_act_id)} %>
- <% end %>
- <%= link_to "More", organization_path(@organization, :type => 1), :class => "more-btn mt30 fr", :target => "_blank" %>
-
-
- <% end %>
-
- <% unless @project_issue_acts.nil? %>
-
- <% @project_issue_acts.each do |act| %>
- <%= render :partial => 'organizations/org_new_project_issues', :locals => {:activity => Issue.find(act.org_act_id)} %>
- <% end %>
- <%= link_to "More", organization_path(@organization, :type => 1), :class => "more-btn mt30 fr", :target => "_blank" %>
-
-
- <% end %>
-
-
-
+
+ <% if field.status == 0 %>
+
+
+ <% if @project_acts.nil? %>
+
暂无内容,敬请期待!
+ <% else %>
+
+
+ <% unless @project_acts.nil? %>
+ <%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts.first(3)} %>
+ <% end %>
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+
+
+ <% end %>
+
-
+ <% else %>
+
+
+ <% if @project_acts.nil? %>
+
暂无内容,敬请期待!
+ <% else %>
+
+ <%= render :partial => 'organizations/org_new_project_act_list', :locals =>{:activities => @project_acts, :field => field, :organization => @organization} %>
+
+
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+ <% end %>
+
+
+ <% end %>
+
<% end %>
<% else %>
<% if field.field_type == "Post" %> <%# 讨论类型 %>
<% message_ats = get_message_org(@organization.id, field.id) %>
<% ids = field.org_document_comments.map{|o| o.id}.join(",") %>
-
-
<%= field.name %><%= field.id %>
discussion zone
-
-
- <% message_ats.each do |act| %>
- <%= render :partial => 'organizations/org_new_forum', :locals => {:activity => act, :field => field, :organization => @organization} %>
- <% end %>
- <%#= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn mt30 fr", :target => "_blank" %>
-
-
- <% unless ids.blank? %>
- <% message_reply_ats = get_message_reply_org(@organization.id, ids) %>
-
- <% message_reply_ats.each do |act| %>
- <%= render :partial => 'organizations/org_new_forum_reply', :locals => {:activity => act, :field => field, :organization => @organization} %>
- <% end %>
-
-
+ <% if field.status == 0 %>
+
+
<%= field.name %>
+ <% if message_ats.blank? %>
+
暂无内容,敬请期待!
+ <% else %>
+
-
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
-
+ <% message_ats.first(3).each do |act| %>
+ <%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %>
+ <% end %>
+
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+
+ <% end %>
+
+
+ <% else %>
+
+
<%= field.name %>
+ <% if message_ats.blank? %>
+
暂无内容,敬请期待!
+ <% else %>
+
+ <% message_ats.each do |act| %>
+ <%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %>
+ <% end %>
+
+
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+ <% end %>
+
+
+
+ <% end %>
<% elsif field.field_type == "Resource" %>
<% org_attachs = get_attach_org2(field) %>
-
<%= field.name %><%= field.id %>
resource dwonload
-
- <%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %>
-
-
+
<%= field.name %>
+ <% if org_attachs.blank? %>
+
暂无内容,敬请期待!
+ <% else %>
+
+ <%= render :partial => 'organizations/org_new_resource', :locals => {:org_attachs => org_attachs} %>
+
+
+
+
+ <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
+
+ <% end %>
-
- <%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
-
diff --git a/app/views/org_subfields/update_status.js.erb b/app/views/org_subfields/update_status.js.erb
new file mode 100644
index 000000000..06982ccfc
--- /dev/null
+++ b/app/views/org_subfields/update_status.js.erb
@@ -0,0 +1,3 @@
+$("#subfield_show_<%= @subfield.id %>").html("<%= @subfield.name %>");
+$("#sub_field_left_lists").html("");
+$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
\ No newline at end of file
diff --git a/app/views/organizations/_org_new_course_act_list.html.erb b/app/views/organizations/_org_new_course_act_list.html.erb
new file mode 100644
index 000000000..18a1e6662
--- /dev/null
+++ b/app/views/organizations/_org_new_course_act_list.html.erb
@@ -0,0 +1,48 @@
+<% activities.each do |act| %>
+ <% if act.org_act_type == "HomeworkCommon" %>
+ <% activity = HomeworkCommon.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.user),:width => "40", :height => "40"), user_path(activity.user), :class => "fl user-img" %>
+
+
+ <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_at %>
+ 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname) %>
+ <%= activity.journals_for_messages.count %>
+
+
+
+ <% elsif act.org_act_type == "Message" %>
+ <% activity = Message.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
+
+
+ <% if activity.parent_id.nil? %>
+ <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <% end %>
+ <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_on %>
+ 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %>
+ <%= activity.children.count %>
+
+
+
+ <% elsif act.org_act_type == "News" %>
+ <% activity = News.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
+
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_at %>
+ 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %>
+ <%= activity.children.count %>
+
+
+ <% end %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/organizations/_org_new_forum_list.html.erb b/app/views/organizations/_org_new_forum_list.html.erb
new file mode 100644
index 000000000..a8e531b50
--- /dev/null
+++ b/app/views/organizations/_org_new_forum_list.html.erb
@@ -0,0 +1,14 @@
+
+
+ <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
+
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_at %>
+ 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %>
+ <%= activity.children.count %>
+
+
+
+
+
diff --git a/app/views/organizations/_org_new_forum_pic.html.erb b/app/views/organizations/_org_new_forum_pic.html.erb
new file mode 100644
index 000000000..c4fd061a5
--- /dev/null
+++ b/app/views/organizations/_org_new_forum_pic.html.erb
@@ -0,0 +1,24 @@
+
+
+
+ <% iamge_path = get_image_path_from_content(activity.content) %>
+ <% if iamge_path.nil? %>
+
+ <% else %>
+
+ <% end %>
+
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
+
+
+
+
+
+
+
+
diff --git a/app/views/organizations/_org_new_project_act_list.html.erb b/app/views/organizations/_org_new_project_act_list.html.erb
new file mode 100644
index 000000000..b3754024f
--- /dev/null
+++ b/app/views/organizations/_org_new_project_act_list.html.erb
@@ -0,0 +1,49 @@
+<% activities.each do |act| %>
+ <% if act.org_act_type == "Issue" %>
+ <% activity = Issue.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
+
+
+ <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <%#= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_on %>
+ 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %>
+ <%= activity.journals.count %>
+
+
+
+ <% elsif act.org_act_type == "Message" %>
+ <% activity = Message.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
+
+
+ <% if activity.parent_id.nil? %>
+ <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+ <% end %>
+ <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_on %>
+ 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %>
+ <%= activity.children.count %>
+
+
+
+ <% elsif act.org_act_type == "News" %>
+ <% activity = News.find(act.org_act_id) %>
+
+ <%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
+
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
+
发布时间:<%= format_date activity.updated_at %>
+ 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %>
+ <%= activity.children.count %>
+
+
+ <% end %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/organizations/_org_new_project_pic.html.erb b/app/views/organizations/_org_new_project_pic.html.erb
new file mode 100644
index 000000000..aa91659ce
--- /dev/null
+++ b/app/views/organizations/_org_new_project_pic.html.erb
@@ -0,0 +1,77 @@
+
+ <% activities.each do |act| %>
+ <% if act.org_act_type == "Issue" %>
+ <% activity = Issue.find(act.org_act_id) %>
+
+
+
+ <% iamge_path = get_image_path_from_content(activity.description) %>
+ <% if iamge_path.nil? %>
+
+ <% else %>
+
+ <% end %>
+
+
+ <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %>
+
+
+
+
+ <% elsif act.org_act_type == "Message" %>
+ <% activity = Message.find(act.org_act_id) %>
+
+
+
+ <% iamge_path = get_image_path_from_content(activity.content) %>
+ <% if iamge_path.nil? %>
+
+ <% else %>
+
+ <% end %>
+
+
+ <% if activity.parent_id.nil? %>
+ <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
+ <% end %>
+
+
+
+
+ <% elsif act.org_act_type == "News" %>
+ <% activity = News.find(act.org_act_id) %>
+
+
+
+ <% iamge_path = get_image_path_from_content(activity.description) %>
+ <% if iamge_path.nil? %>
+
+ <% else %>
+
+ <% end %>
+
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
+
+
+
+
+
+ <% end %>
+
+ <% end %>
+
diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb
index d907ac33e..e16e91486 100644
--- a/app/views/organizations/_subfield_list.html.erb
+++ b/app/views/organizations/_subfield_list.html.erb
@@ -2,6 +2,7 @@
顺序
已有栏目
状态
+
排列
类型
域名目录
@@ -21,8 +22,18 @@
<%= name %>
默认
+
+ <%= 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 %>
+ <%=field.status== 1 ? "列表" : "图片" %>
+
+
+ <%= select( :name,:group_id, subfield_status_option,
+ { :include_blank => false,:selected => field.status},
+ {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:30px;"}) %>
+ <% end %>
+
默认
-
<%= field.hide==0?"设为隐藏":"设为可见" %>
+
<%= field.hide==0?"隐藏":"可见" %>
<% else %>
@@ -42,6 +53,21 @@