消息界面调整
This commit is contained in:
parent
17fad1f291
commit
4013ff486a
|
@ -35,6 +35,9 @@ class Message < ActiveRecord::Base
|
|||
# 课程动态
|
||||
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
|
||||
# end
|
||||
# 课程消息
|
||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
#end
|
||||
|
||||
has_many :ActivityNotifies,:as => :activity, :dependent => :destroy
|
||||
|
||||
|
@ -70,7 +73,7 @@ class Message < ActiveRecord::Base
|
|||
after_update :update_messages_board
|
||||
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets
|
||||
|
||||
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :send_mail
|
||||
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_course_message, :send_mail
|
||||
#before_save :be_user_score
|
||||
|
||||
scope :visible, lambda {|*args|
|
||||
|
|
|
@ -22,29 +22,35 @@
|
|||
<div>
|
||||
<% @user_course_messages.each do |ucm| %>
|
||||
<% if ucm.course_message_type == "News" %>
|
||||
<ul class="homepageNewsList">
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><img src="images/newsPortrait.png" width="35" height="35" /></a></li>
|
||||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.author %></a></li>
|
||||
<li class="homepageNewsType fl">发布通知</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"><%= ucm.course_message.title %></a></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to format_activity_title("#{l(:label_news)}: #{ucm.course_message.title}"), {:controller => 'news', :action => 'show', :id => ucm.course_message.id} %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ucm.course_message_type == "HomeworkCommon" %>
|
||||
<ul class="homepageNewsList">
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><img src="images/newsPortrait.png" width="35" height="35" /></a></li>
|
||||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li>
|
||||
<li class="homepageNewsType fl">发布作业</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"><%= ucm.course_message.name %></a></li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to format_activity_title("#{ucm.course_message.name}"), {:controller => 'news', :action => 'show', :id => ucm.course_message.id} %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ucm.course_message_type == "Poll" %>
|
||||
<ul class="homepageNewsList">
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><img src="images/newsPortrait.png" width="35" height="35" /></a></li>
|
||||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li>
|
||||
<li class="homepageNewsType fl">发布问卷</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"><%= ucm.course_message.polls_name %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -586,9 +586,10 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
|
|||
.newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:35px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2;}
|
||||
.homepageRightBlock {}
|
||||
.homepageNewsList {width:710px; height:39px; line-height:39px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin:0 auto;}
|
||||
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
|
||||
.homepageNewsPublisher {width:95px; font-size:12px; color:#15bccf; display:block;}
|
||||
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
|
||||
.homepageNewsContent {width:445px; font-size:12px; color:#4b4b4b; display:block;}
|
||||
.homepageNewsContent {width:405px; font-size:12px; color:#4b4b4b; display:block;}
|
||||
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
|
||||
a.homepageWhite {color:#ffffff;}
|
||||
a.homepageWhite:hover {color:#a1ebff}
|
||||
|
|
Loading…
Reference in New Issue