From 2c865069d31c3268a10af30000c6cdc878ef6491 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 13 Aug 2015 22:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E6=B6=88=E6=81=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 14 ++- app/views/layouts/_base_header_new.html.erb | 5 + app/views/users/user_messages.html.erb | 117 ++++++++++++++++++++ config/routes.rb | 2 + 4 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 app/views/users/user_messages.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 410bd44e1..f2b5b1af0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -28,6 +28,7 @@ class UsersController < ApplicationController # menu_item :requirement_focus, :only => :watch_bids menu_item :requirement_focus, :only => :watch_contests menu_item :user_newfeedback, :only => :user_newfeedback + menu_item :user_messages, :only => :user_messages #Ended by young @@ -40,14 +41,14 @@ class UsersController < ApplicationController :user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index, - :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist] + :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index, - :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist] + :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages] before_filter :auth_user_extension, only: :show #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects @@ -95,6 +96,15 @@ class UsersController < ApplicationController end end + # 用户消息 + def user_messages + #@user_messges = User.current.forge_messages + respond_to do |format| + format.html{render :layout=>'base_users_new'} + format.api + end + end + def user_projects_index if User.current.admin? memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first diff --git a/app/views/layouts/_base_header_new.html.erb b/app/views/layouts/_base_header_new.html.erb index 67c750fe4..a3b5702c1 100644 --- a/app/views/layouts/_base_header_new.html.erb +++ b/app/views/layouts/_base_header_new.html.erb @@ -71,6 +71,11 @@ +
  • + <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', + {:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user}, + {:class => 'my-message'} if User.current.logged?%> +
  • <% end %> diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb new file mode 100644 index 000000000..463381db8 --- /dev/null +++ b/app/views/users/user_messages.html.erb @@ -0,0 +1,117 @@ +
    + + + 新建课程 + +
    + + +
    + +
    + +
    + + + + + diff --git a/config/routes.rb b/config/routes.rb index cdcb1126c..d139864b2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -322,6 +322,7 @@ RedmineApp::Application.routes.draw do match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get match 'user_homeworks', :to => 'users#user_homeworks', :via => :get match 'watch_projects', :to => 'users#watch_projects', :via => :get + # added by bai match 'show_score', :to => 'users#show_score', :via => :get match 'topic_score_index', :to => 'users#topic_score_index', :via => [:get, :post] @@ -349,6 +350,7 @@ RedmineApp::Application.routes.draw do end match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback" match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get + match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get #end match 'my/account', :via => [:get, :post]