From 42745092c591685171ee617369f70e27dc0d83bf Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 19 Sep 2015 12:58:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BB=96=E4=BA=BA=E4=B8=8D=E8=83=BD=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=88=91=E7=9A=84=E6=B6=88=E6=81=AF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 +++- app/views/users/user_messages.html.erb | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d3921d44a..0783d1805 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -95,9 +95,11 @@ class UsersController < ApplicationController # 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复 # issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment) def user_messages - unless User.current.logged? + if !User.current.logged? redirect_to signin_url return + elsif @user != User.current && !User.current.admin? + return render_403 end # 记录当前点击按钮的时间 # 考虑到用户未退出刷新消息页面 diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index b9e626f2d..46964b14d 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -54,17 +54,17 @@ 【系统消息】
  • - <%= link_to usm.subject.nil? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current), + <%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current), :id => "content_link_#{usm.id}", :onmouseover =>"message_titile_show($(this),event);", :onmouseout => "message_titile_hide($(this));" %>
  • From f4d11f884457f5636c86f46248156001cb1b8f32 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 19 Sep 2015 13:46:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=A1=B5=E9=9D=A2=E4=B8=AD=EF=BC=8C=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=A4=A7=E5=B0=8F=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_system_messages.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/users/user_system_messages.html.erb b/app/views/users/user_system_messages.html.erb index 3b8bd9fb6..899cd7a8f 100644 --- a/app/views/users/user_system_messages.html.erb +++ b/app/views/users/user_system_messages.html.erb @@ -43,9 +43,11 @@ <%= system_message.subject.nil? ? "系统消息" : system_message.subject %>
    -

    - <%= system_message.content.nil? ? system_message.description.html_safe : system_message.content.html_safe %> -

    +
    +

    + <%= system_message.content.nil? ? system_message.description.html_safe : system_message.content.html_safe %> +

    +

    截止时间:<%= format_time(system_message.created_at) %>