右一模式
This commit is contained in:
parent
76732a3034
commit
0b3ec0322f
|
@ -66,11 +66,40 @@ module OrganizationsHelper
|
||||||
def org_user_by_type obj
|
def org_user_by_type obj
|
||||||
case obj.act_type
|
case obj.act_type
|
||||||
when "Message"
|
when "Message"
|
||||||
|
user = obj.act.author
|
||||||
when "News"
|
when "News"
|
||||||
|
user = obj.act.author
|
||||||
when "HomeworkCommon"
|
when "HomeworkCommon"
|
||||||
|
user = obj.act.user
|
||||||
when "Issue"
|
when "Issue"
|
||||||
|
user = obj.act.author
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
#排列下拉框
|
#排列下拉框
|
||||||
|
|
|
@ -5,44 +5,32 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<ul class="por_news_list clear">
|
<ul class="por_news_list clear">
|
||||||
<% @acts.each do |obj| %>
|
<% @acts.each do |obj| %>
|
||||||
<% if obj.act_type = "Message" %>
|
<% user = org_user_by_type(obj) %>
|
||||||
<% user = org_user_by_type(obj) %>
|
<% title = org_title_by_type(obj) %>
|
||||||
<% title = org_title_by_type(obj) %>
|
<% content = org_content_by_type(obj) %>
|
||||||
<% content = org_content_by_type(obj) %>
|
<li>
|
||||||
<% message = obj.act %>
|
<%= link_to image_tag(url_to_avatar(user),:width => "43", :height => "43", :class => "por_users_img"), user_path(user), :target => "_blank", :class => "fl" %>
|
||||||
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
|
<div class="por_news_txt fl">
|
||||||
<li>
|
<p class="por_news_p fl">
|
||||||
<%= 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 fl", :target => "_blank" %>
|
||||||
<div class="por_news_txt fl">
|
<span class="fl"> : </span>
|
||||||
<p class="por_news_p fl">
|
<% if obj.act_type = "Message" %>
|
||||||
<%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name fl", :target => "_blank" %>
|
<%= link_to title, board_message_path(obj.act.board.id, obj.act.id) %>
|
||||||
<span class="fl"> : </span>
|
<% elsif obj.act_type = "News" %>
|
||||||
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 28, :maxwidth => 0, :cl => ""} %>
|
<%= link_to title, news_path(obj.act.id) %>
|
||||||
</p>
|
<% elsif obj.act_type = "HomeworkCommon" %>
|
||||||
<p><span class="por_time fl"><%= time_from_now(message.created_on) %> </span>
|
<%= link_to title, student_work_index_url_in_org(obj.act.id) %>
|
||||||
<!--<a href="javascript:void(0);" target="_blank" class="por_zan fr">50</a>-->
|
<% elsif obj.act_type = "Issue" %>
|
||||||
</p>
|
<%= link_to title, issue_path(obj.act.id) %>
|
||||||
</div>
|
<% end %>
|
||||||
<div class="cl"></div>
|
</p>
|
||||||
</li>
|
<p><span class="por_time fl"><%= time_from_now(obj.act.created_on) %> </span>
|
||||||
<% elsif obj.act_type = "News" %>
|
<!--<a href="javascript:void(0);" target="_blank" class="por_zan fr">50</a>-->
|
||||||
|
</p>
|
||||||
<% elsif obj.act_type = "HomeworkCommon" %>
|
</div>
|
||||||
<% elsif obj.act_type = "Issue" %>
|
<div class="cl"></div>
|
||||||
<% end %>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li >
|
|
||||||
<a href="javascript:void(0);" target="_blank" class="fl"><img src="/images/org_custom/homepageImage.jpg" width="43" height="43" alt="" class="por_users_img"/></a>
|
|
||||||
<div class="por_news_txt fl">
|
|
||||||
<p class="por_news_p fl">
|
|
||||||
<a href="javascript:void(0);" target="_blank" class=" por_hot_name fl"> 叮当当 </a><span class="fl"> : </span>
|
|
||||||
Trustie社区新版上线了必须支持一下,比以前好用很多....
|
|
||||||
</p>
|
|
||||||
<p><span class="por_time fl">1分钟前 </span><a href="javascript:void(0);" target="_blank" class="por_zan fr">500</a></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div><!--por_news end-->
|
</div><!--por_news end-->
|
|
@ -1,16 +1,9 @@
|
||||||
<% if cl.nil? %>
|
<p class="<%= cl %>" id="activity_description_<%= user_activity_id %>">
|
||||||
<span class="<%= cl %>" id="activity_description_<%= user_activity_id %>">
|
|
||||||
<span id="intro_content_<%= user_activity_id%>">
|
<span id="intro_content_<%= user_activity_id%>">
|
||||||
<%= content.to_s.html_safe%>
|
<%= content.to_s.html_safe%>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</p>
|
||||||
<% else %>
|
|
||||||
<p class="<%= cl %>" id="activity_description_<%= user_activity_id %>">
|
|
||||||
<span id="intro_content_<%= user_activity_id%>">
|
|
||||||
<%= content.to_s.html_safe%>
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#intro_content_<%= user_activity_id %>").hide();
|
$("#intro_content_<%= user_activity_id %>").hide();
|
||||||
|
|
Loading…
Reference in New Issue