From 491e4d12c655131a4bdf0c04ee147271e6e92005 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 10 Oct 2015 16:03:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E8=AF=BE=E7=A8=8B=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E3=80=81=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB=E5=AF=B9=E5=BA=94=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=A0=87=E9=A2=98=202.=E5=B0=86=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E6=94=BE=E5=9C=A8=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=B1=80=E9=83=A8=E9=A1=B5=E9=9D=A2=E4=B8=AD=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E4=BE=BFUser=5Fmessages=E9=A1=B5=E9=9D=A2=E5=92=8CUser=5Fsyste?= =?UTF-8?q?m=5Fmessages=E9=83=BD=E8=B0=83=E7=94=A8=E5=AE=83=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E4=BB=A3=E7=A0=81=E9=87=8D=E5=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/users_helper.rb | 6 ++++ .../users/_selector_for_messages.html.erb | 34 ++++++++++++++++++ app/views/users/user_messages.html.erb | 35 +------------------ app/views/users/user_system_messages.html.erb | 33 +---------------- 4 files changed, 42 insertions(+), 66 deletions(-) create mode 100644 app/views/users/_selector_for_messages.html.erb diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index f6b083b4d..2935d018a 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -68,8 +68,14 @@ module UsersHelper '课程讨论' when 'course_news' '课程通知' + when 'poll' + '课程问卷' when 'issue' '项目任务' + when 'forge_message' + '项目讨论' + when 'forge_news' + '项目新闻' when 'forum' '贴吧帖子' when 'user_feedback' diff --git a/app/views/users/_selector_for_messages.html.erb b/app/views/users/_selector_for_messages.html.erb new file mode 100644 index 000000000..b0f867e18 --- /dev/null +++ b/app/views/users/_selector_for_messages.html.erb @@ -0,0 +1,34 @@ +
+
<%= title_for_message(params[:type]) %>
+ +
\ No newline at end of file diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 6f583f76d..f83e5617c 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -1,37 +1,4 @@ -
-
<%= title_for_message(params[:type]) %>
- -
+<%= render :partial => 'users/selector_for_messages'%>
<% if (!@message_alls.nil? && @message_alls.count >0) %> diff --git a/app/views/users/user_system_messages.html.erb b/app/views/users/user_system_messages.html.erb index 899cd7a8f..64b0dff0c 100644 --- a/app/views/users/user_system_messages.html.erb +++ b/app/views/users/user_system_messages.html.erb @@ -1,35 +1,4 @@ -
-
系统消息
-
    -
  • -
      -
    • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
    • -
    • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
    • -
    • <%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
    • - <%# 课程相关消息 %> -
    • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
    • -
    • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
    • -
    • <%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %>
    • - - - - - <%# 项目相关消息 %> -
    • <%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %>
    • - - - - - <%# 项目相关消息 %> -
    • <%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %>
    • - <%# 系统贴吧 %> -
    • <%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %>
    • - <%# 系统消息 %> -
    • <%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %>
    • -
    -
  • -
-
+<%= render :partial => 'users/selector_for_messages'%> <% @sytem_messages.each do |system_message| %>