组织新样式
This commit is contained in:
parent
cf946687d0
commit
c6f6030e10
|
@ -34,6 +34,7 @@ class OrganizationsController < ApplicationController
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@organization = Organization.new
|
@organization = Organization.new
|
||||||
render :layout => 'new_base'
|
render :layout => 'new_base'
|
||||||
|
@ -74,10 +75,12 @@ class OrganizationsController < ApplicationController
|
||||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||||
@subfield_content = @organization.org_subfields.order("priority")
|
@subfield_content = @organization.org_subfields.order("priority")
|
||||||
# 项目两种动态
|
# 项目两种动态
|
||||||
|
@project_acts = get_project_activities_org @organization
|
||||||
@project_issue_acts = get_project_issue_activities_org @organization
|
@project_issue_acts = get_project_issue_activities_org @organization
|
||||||
@project_message_acts = get_project_message_activities_org @organization
|
@project_message_acts = get_project_message_activities_org @organization
|
||||||
# 磕碜动态
|
# 磕碜动态
|
||||||
#@project_acts_issues = get_project_activities_org @organization
|
#@project_acts_issues = get_project_activities_org @organization
|
||||||
|
@course_acts = get_course_activities_org @organization
|
||||||
@course_acts_homework = get_course_homework_activities_org @organization
|
@course_acts_homework = get_course_homework_activities_org @organization
|
||||||
@course_acts_message = get_course_message_activities_org @organization
|
@course_acts_message = get_course_message_activities_org @organization
|
||||||
@course_acts_news = get_course_news_activities_org @organization
|
@course_acts_news = get_course_news_activities_org @organization
|
||||||
|
@ -153,6 +156,29 @@ class OrganizationsController < ApplicationController
|
||||||
#project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project' and org_act_type = 'issue' order by updated_at desc limit 4;")
|
#project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project' and org_act_type = 'issue' order by updated_at desc limit 4;")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 获取整过项目的动态
|
||||||
|
def get_project_activities_org org
|
||||||
|
project_ids = org.projects.map{|project| project.id}.join(",")
|
||||||
|
unless project_ids.blank?
|
||||||
|
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project' order by updated_at desc limit 3;")
|
||||||
|
else
|
||||||
|
project_acts = nil
|
||||||
|
end
|
||||||
|
#project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project' and org_act_type = 'issue' order by updated_at desc limit 4;")
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取整过课程的动态
|
||||||
|
def get_course_activities_org org
|
||||||
|
course_ids = org.courses.map{|course| course.id}.join(",")
|
||||||
|
unless course_ids.blank?
|
||||||
|
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' order by updated_at desc limit 6;")
|
||||||
|
else
|
||||||
|
project_acts = nil
|
||||||
|
end
|
||||||
|
#project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' order by updated_at desc limit 5;")
|
||||||
|
#project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course' and org_act_type = 'HomeworkCommon' order by updated_at desc limit 1;")
|
||||||
|
end
|
||||||
|
|
||||||
def get_course_homework_activities_org org
|
def get_course_homework_activities_org org
|
||||||
course_ids = org.courses.map{|course| course.id}.join(",")
|
course_ids = org.courses.map{|course| course.id}.join(",")
|
||||||
unless course_ids.blank?
|
unless course_ids.blank?
|
||||||
|
@ -228,11 +254,6 @@ class OrganizationsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def clear_org_avatar_temp
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_homepage
|
def set_homepage
|
||||||
@org = Organization.find(params[:id])
|
@org = Organization.find(params[:id])
|
||||||
@org.home_id = params[:home_id]
|
@org.home_id = params[:home_id]
|
||||||
|
|
|
@ -30,7 +30,7 @@ module OrganizationsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_message_org(org_id, field_id)
|
def get_message_org(org_id, field_id)
|
||||||
OrgDocumentComment.find_by_sql("SELECT * FROM org_document_comments where organization_id = #{org_id} and org_subfield_id = #{field_id} and parent_id is null order by updated_at desc limit 2;")
|
OrgDocumentComment.find_by_sql("SELECT * FROM org_document_comments where organization_id = #{org_id} and org_subfield_id = #{field_id} and parent_id is null order by updated_at desc limit 3;")
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_message_reply_org(org_id, ids)
|
def get_message_reply_org(org_id, ids)
|
||||||
|
|
|
@ -110,9 +110,10 @@
|
||||||
<% if is_default_field?(field) %>
|
<% if is_default_field?(field) %>
|
||||||
<% case field.name %>
|
<% case field.name %>
|
||||||
<% when 'course' %>
|
<% when 'course' %>
|
||||||
<div class="box1 bg-grey">
|
<div class="box1" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||||
|
<% if false %>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="box-top" style="display:<%= field.hide == 0?'block':'none' %>;" id="course_<%= field.id %>"><h2 class="box-title">课程动态</h2><p class="box-title-p">course activities</p></div>
|
<div class="box-top" id="course_<%= field.id %>"><h2 class="box-title">课程动态</h2><p class="box-title-p">course activities</p></div>
|
||||||
<div class="course-list">
|
<div class="course-list">
|
||||||
<ul class="clearfix">
|
<ul class="clearfix">
|
||||||
<% unless @course_acts_homework.nil? %>
|
<% unless @course_acts_homework.nil? %>
|
||||||
|
@ -140,68 +141,81 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div><!--content end-->
|
</div><!--content end-->
|
||||||
|
<% else %>
|
||||||
|
<div class="content">
|
||||||
|
<div class="box-top" id="course_<%= field.id %>"><h2 class="box-title">课程动态</h2></div>
|
||||||
|
<div class="row">
|
||||||
|
<%= render :partial => 'organizations/org_new_course_act_list', :locals =>{:activities => @course_acts, :field => field, :organization => @organization} %>
|
||||||
|
<!--row-ziyuan end-->
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!--row end-->
|
||||||
|
<% end %>
|
||||||
</div><!--box1 end-->
|
</div><!--box1 end-->
|
||||||
<% when 'project' %>
|
<% when 'project' %>
|
||||||
<div class="box1">
|
<% if true %>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="box-top" style="display:<%= field.hide == 0?'block':'none' %>;" id="project_<%= field.id %>"><h2 class="box-title">项目动态</h2><p class="box-title-p">project activities</p></div>
|
<div class="box-top" id="course_<%= field.id %>"><h2 class="box-title">项目动态</h2><p class="box-title-p"></p></div>
|
||||||
|
<div class="course-list">
|
||||||
|
<ul class="clearfix">
|
||||||
|
<% unless @project_acts.nil? %>
|
||||||
|
|
||||||
|
<%= render :partial => 'organizations/org_new_project_pic', :locals => {:activities => @project_acts} %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!--content end-->
|
||||||
|
<% else %>
|
||||||
|
<div class="content">
|
||||||
|
<div class="box-top" id="resource_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<% unless @project_message_acts.nil? %>
|
<%= render :partial => 'organizations/org_new_project_act_list', :locals =>{:activities => @project_acts, :field => field, :organization => @organization} %>
|
||||||
<div class="row-l fl">
|
<!--row-ziyuan end-->
|
||||||
<!-- text -->
|
|
||||||
<% @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" %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<!-- row-l end -->
|
|
||||||
<% unless @project_issue_acts.nil? %>
|
|
||||||
<div class="row-r fr">
|
|
||||||
<% @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" %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<!-- article-rwrap end -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div><!--content end-->
|
<%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||||
</div><!--box2 end-->
|
<div class="cl"></div>
|
||||||
|
</div><!--row end-->
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||||
<% message_ats = get_message_org(@organization.id, field.id) %>
|
<% message_ats = get_message_org(@organization.id, field.id) %>
|
||||||
<% ids = field.org_document_comments.map{|o| o.id}.join(",") %>
|
<% ids = field.org_document_comments.map{|o| o.id}.join(",") %>
|
||||||
<div class="box1 bg-grey" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
<div class="box1 bg-grey" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||||
<div class="content">
|
<% if false %>
|
||||||
<div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2><p class="box-title-p">discussion zone</p></div>
|
<div class="content">
|
||||||
<div class="row">
|
<div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2></div>
|
||||||
<div class="con-left fl">
|
<div class="course-list">
|
||||||
<% message_ats.each do |act| %>
|
<ul class="clearfix">
|
||||||
<%= 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" %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div><!--con-left end-->
|
|
||||||
<% unless ids.blank? %>
|
|
||||||
<% message_reply_ats = get_message_reply_org(@organization.id, ids) %>
|
|
||||||
<div class="con-right fr">
|
|
||||||
<% message_reply_ats.each do |act| %>
|
|
||||||
<%= render :partial => 'organizations/org_new_forum_reply', :locals => {:activity => act, :field => field, :organization => @organization} %>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div><!--con-right end--->
|
|
||||||
|
|
||||||
<% end %>
|
<% message_ats.each do |act| %>
|
||||||
</div>
|
<%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %>
|
||||||
</div><!-content end-->
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
|
</ul>
|
||||||
<div class="cl"></div>
|
</div>
|
||||||
|
</div><!--content end-->
|
||||||
|
<% else %>
|
||||||
|
<div class="content">
|
||||||
|
<div class="box-top" id="resource_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2></div>
|
||||||
|
<div class="row">
|
||||||
|
<% message_ats.each do |act| %>
|
||||||
|
<%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %>
|
||||||
|
<% end %>
|
||||||
|
<!--row-ziyuan end-->
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<%= link_to "More", organization_path(@organization, :org_subfield_id => field.id), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!--row end-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
</div><!--box1 end-->
|
</div><!--box1 end-->
|
||||||
<% elsif field.field_type == "Resource" %>
|
<% elsif field.field_type == "Resource" %>
|
||||||
<% org_attachs = get_attach_org2(field) %>
|
<% org_attachs = get_attach_org2(field) %>
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
<% activities.each do |act| %>
|
||||||
|
<% if act.org_act_type == "HomeworkCommon" %>
|
||||||
|
<% activity = HomeworkCommon.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.user),:width => "40", :height => "40"), user_path(activity.user), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<%= 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" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
|
||||||
|
<span> 作者:<%= activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.journals_for_messages.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<% 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" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_on %></span>
|
||||||
|
<span> 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
|
||||||
|
<span> 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
|
||||||
|
<span> 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<li>
|
||||||
|
<a href="/#" title="" >
|
||||||
|
<div class="course-list-img">
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<img width="370" height="220" alt="#" src="/images/org_new_style/default-img.jpg">
|
||||||
|
<% else %>
|
||||||
|
<img width="370" height="220" src="/files/uploads/image<%= iamge_path %>" alt="" />
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<h5>
|
||||||
|
<span><%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %></span>
|
||||||
|
</h5>
|
||||||
|
<div class="item-btm clearfix">
|
||||||
|
<a class="publisher-name fl" href="#" target="_blank"><%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></a>
|
||||||
|
<p class="pass-time fl"><span><%= format_date activity.created_at %></span></p>
|
||||||
|
<div class="fr right-info"> <span> <%= activity.children.count %></span></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<% activities.each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<%= 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" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_on %></span>
|
||||||
|
<span> 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.journals.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author),:width => "40", :height => "40"), user_path(activity.author), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<% 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" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_on %></span>
|
||||||
|
<span> 作者:<%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<div class="row-ziyuan fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
|
||||||
|
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||||
|
<div class="ziyuan-box fl">
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||||
|
<p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
|
||||||
|
<span> 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></span>
|
||||||
|
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||||
|
</div>
|
||||||
|
</div><!--row-ziyuan end-->
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
|
@ -0,0 +1,77 @@
|
||||||
|
|
||||||
|
<% activities.each do |act| %>
|
||||||
|
<% if act.org_act_type == "Issue" %>
|
||||||
|
<% activity = Issue.find(act.org_act_id) %>
|
||||||
|
<li>
|
||||||
|
<a href="/#" title="">
|
||||||
|
<div class="course-list-img">
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<img width="370" height="220" alt="#" src="/images/org_new_style/default-img.jpg">
|
||||||
|
<% else %>
|
||||||
|
<img width="370" height="220" src="/files/uploads/image<%= iamge_path %>" alt="" />
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<h5>
|
||||||
|
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank' %>
|
||||||
|
</h5>
|
||||||
|
<div class="item-btm clearfix">
|
||||||
|
<a class="publisher-name fl" href="#" target="_blank"><%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></a>
|
||||||
|
<p class="pass-time fl"><span><%= format_date activity.updated_on %></span></p>
|
||||||
|
<div class="fr right-info"> <span> <%= activity.journals.count %></span></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<% elsif act.org_act_type == "Message" %>
|
||||||
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
<li>
|
||||||
|
<a href="/#" title="">
|
||||||
|
<div class="course-list-img">
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<img width="370" height="220" alt="#" src="/images/org_new_style/default-img.jpg">
|
||||||
|
<% else %>
|
||||||
|
<img width="370" height="220" src="/files/uploads/image<%= iamge_path %>" alt="" />
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<h5>
|
||||||
|
<% 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 %>
|
||||||
|
</h5>
|
||||||
|
<div class="item-btm clearfix">
|
||||||
|
<a class="publisher-name fl" href="#" target="_blank"><%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></a>
|
||||||
|
<p class="pass-time fl"><span><%= format_date activity.updated_on %></span></p>
|
||||||
|
<div class="fr right-info"> <span> <%= activity.children.count %></span></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<% elsif act.org_act_type == "News" %>
|
||||||
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
<li>
|
||||||
|
<a href="/#" title="">
|
||||||
|
<div class="course-list-img">
|
||||||
|
<% iamge_path = get_image_path_from_content(activity.description) %>
|
||||||
|
<% if iamge_path.nil? %>
|
||||||
|
<img width="370" height="220" alt="#" src="/images/org_new_style/default-img.jpg">
|
||||||
|
<% else %>
|
||||||
|
<img width="370" height="220" src="/files/uploads/image<%= iamge_path %>" alt="" />
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<h5>
|
||||||
|
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
|
||||||
|
</h5>
|
||||||
|
<div class="item-btm clearfix">
|
||||||
|
<a class="publisher-name fl" href="#" target="_blank"><%= activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname) %></a>
|
||||||
|
<p class="pass-time fl"><span><%= format_date activity.created_on %></span></p>
|
||||||
|
<div class="fr right-info"> <span> <%= activity.comments.count %></span></div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
class AddTypeToOrganization < ActiveRecord::Migration
|
|
||||||
def change
|
|
||||||
add_column :organizations, :type, :integer, :default => true
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20160328022623) do
|
ActiveRecord::Schema.define(:version => 20160331060004) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -1302,6 +1302,7 @@ ActiveRecord::Schema.define(:version => 20160328022623) do
|
||||||
t.boolean "allow_guest_download", :default => true
|
t.boolean "allow_guest_download", :default => true
|
||||||
t.integer "visits", :default => 0
|
t.integer "visits", :default => 0
|
||||||
t.integer "show_mode", :default => 0
|
t.integer "show_mode", :default => 0
|
||||||
|
t.integer "type", :default => 1
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "phone_app_versions", :force => true do |t|
|
create_table "phone_app_versions", :force => true do |t|
|
||||||
|
|
Loading…
Reference in New Issue