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/_course_message.html.erb b/app/views/users/_course_message.html.erb index dcd33e3c1..703882bd1 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -97,9 +97,9 @@ <% end %> -
/* id="reply_input_<%= user_activity_id%>" style="display: <%= (first_user_activity==user_activity_id && page==0)? '' : 'none'%>"*/ +
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 4d030737b..ef01022ce 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -70,19 +70,20 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
-
- <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> - - -
- 发送 -
-

- <% end%> +
+
+ <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> + + +
+ 发送 +
+

+ <% end%> +
+
-
\ No newline at end of file diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 4922ed882..29bed1499 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -115,20 +115,21 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
-
- <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> - - -
- 发送 -
-

- <% end%> +
+
+ <%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%> + + +
+ 发送 +
+

+ <% end%> +
+
-
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 2edfcbd44..2cce8f83a 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -84,21 +84,22 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
-
-
- <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> - - - -
- 发送 -
-

- <% end%> +
+
+ <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> + + + +
+ 发送 +
+

+ <% 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));" %>