From dc12301e4f474ce22c3254eade262ea2f9bfbf17 Mon Sep 17 00:00:00 2001 From: huangjingquan Date: Thu, 8 Aug 2013 09:38:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E5=9B=9E=E9=80=80=E5=86=85?= =?UTF-8?q?=E5=AE=B9=EF=BC=88=E4=BF=AE=E6=94=B9=E6=97=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=92=8C=E6=B4=BB=E5=8A=A8=E6=97=B6=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=89=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 6 ++++-- app/views/users/show.html.erb | 2 ++ app/views/users/user_projects.html.erb | 5 ++++- config/locales/zh.yml | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2937f4fce..c3ab04d50 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -45,13 +45,15 @@ class UsersController < ApplicationController events = Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 20) @events_by_day = events.group_by(&:event_date) + #add by huang unless User.current.admin? - if !@user.active? || (@user != User.current && @memberships.empty? && events.empty?) + if !@user.active? #|| (@user != User.current && @memberships.empty? && events.empty?) render_404 return end end - + #end + respond_to do |format| format.html format.api diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4bfc4b070..f53d489d8 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -33,4 +33,6 @@ <% end %> +<% else %> +<%= l(:label_user_activities) %> <% end %> \ No newline at end of file diff --git a/app/views/users/user_projects.html.erb b/app/views/users/user_projects.html.erb index 8595bfb84..12d5fc943 100644 --- a/app/views/users/user_projects.html.erb +++ b/app/views/users/user_projects.html.erb @@ -31,6 +31,9 @@ <% end %> <% else %> -<%= l(:label_prohect_unadd) %><%= link_to"新建",:controller=>'projects',:action=>'new'%> +<% if @user != User.current %> +<%= l(:label_project_un) %> +<% else %><%= l(:label_project_unadd) %><%= link_to"新建",:controller=>'projects',:action=>'new'%> +<% end %> <% end %> <%= call_hook :view_account_left_bottom, :user => @user %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 30534561d..0ade9955a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -768,13 +768,16 @@ zh: label_user_login: "最后登录:" label_user_mail: "邮件地址:" label_user_joinin: "加入时间:" + label_user_activities: "您当前还没有活动,快来加入我们吧!" label_project_overview: "概述" label_project_tool: "工具" label_project_defect: "缺陷" label_project_newother: "查看其他评论" label_project_newshare: "分享了" label_project_newadd: "添加了" - label_prohect_unadd: "暂无项目,赶快去创建吧!" + label_project_unadd: "暂无项目,赶快去创建吧!" + label_project_un: "该用户暂未参入任何项目!" + #end by huang label_user_mail_option_selected: "收取选中项目的所有通知..."