This commit is contained in:
sw 2015-10-09 14:19:25 +08:00
commit 7c825baf19
5 changed files with 9 additions and 12 deletions

View File

@ -112,17 +112,10 @@ class UsersController < ApplicationController
case params[:type] case params[:type]
when nil when nil
@message_alls = [] @message_alls = []
system_message_types = MessageAll.where("message_type =?", "SystemMessage").order("created_at desc") messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user, "SystemMessage", "SystemMessage").order("created_at desc")
messages = MessageAll.where("user_id =? and message_type !=?" ,@user, "SystemMessage").order("created_at desc")
messages.each do |message_all| messages.each do |message_all|
@message_alls << message_all.message @message_alls << message_all.message
end end
# 系统消息需要给每个人发送,之所以这样做,可以避免遍历系统所有用户
system_message_types.each do |system_message_type|
@message_alls << system_message_type.message
end
# 取出所有符合条件的按照创建时间排序
@message_alls = @message_alls.sort {|a,b| b.created_at <=> a.created_at}
when 'unviewed' when 'unviewed'
@message_alls = [] @message_alls = []
messages = MessageAll.where("user_id =?", @user).order("created_at desc") messages = MessageAll.where("user_id =?", @user).order("created_at desc")

View File

@ -21,6 +21,7 @@
<div class="postDetailReply"> <div class="postDetailReply">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a> <a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> <%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -110,10 +110,10 @@
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyAddress(this);" %> <%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyAddress(this);" %>
</li> </li>
<li> <li>
<%= text_field_tag 'last_name', '', :class => "fb_item_first_name fl", :placeholder => l(:label_input_email_lastname), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyLastName(this);" %> <%= text_field_tag 'last_name', '', :class => "fb_item_first_name fl", :placeholder => l(:label_input_email_lastname), :onkeyup => "this.value=this.value.replace(' ','')", :onblur => "verifyLastName(this);" %>
</li> </li>
<li> <li>
<%= text_field_tag 'first_name', '', :class => "fb_item_last_name fl", :placeholder => l(:label_input_email_firstname), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyFirstName(this);" %> <%= text_field_tag 'first_name', '', :class => "fb_item_last_name fl", :placeholder => l(:label_input_email_firstname), :onkeyup => "this.value=this.value.replace(' ','')", :onblur => "verifyFirstName(this);" %>
</li> </li>
<li> <li>
<select class="fb_item_gender fl" id="gender" name="gender"><option value="">性别</option><option value="0">男</option><option value="1">女</option></select> <select class="fb_item_gender fl" id="gender" name="gender"><option value="">性别</option><option value="0">男</option><option value="1">女</option></select>

View File

@ -191,8 +191,10 @@
<div style="display: none" class="message_title_red system_message_style"> <div style="display: none" class="message_title_red system_message_style">
<p> <p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好! <%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败,作业详情如下: <%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败,
失败原因提交作品的人数低于2人
</p> </p>
<p>作业详情如下:</p>
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p> <p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p> <p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
</div> </div>

View File

@ -802,7 +802,8 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;} .postDetailDate {color:#888888; font-size:12px; float:left;}
.postDetailReply { margin-top:28px; color:#888888; float:right;} .postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
.disablePostLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; padding-right: 5px; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;} a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
.postDetailInput {width:713px; height:28px; border:1px solid #d9d9d9; outline:none !important;} .postDetailInput {width:713px; height:28px; border:1px solid #d9d9d9; outline:none !important;}