From 213939b47491b027628ae7d9d213706eaaaf43f6 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 23 May 2014 10:59:52 +0800 Subject: [PATCH] realname --- app/models/user.rb | 6 +++++- app/views/welcome/course.html.erb | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index e54658274..41681ded0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -200,7 +200,7 @@ class User < Principal #选择项目成员时显示的用户信息文字 def userInfo - info=self.name + ' (' + self.login + ')'; + info=self.nickname + ' (' + self.realname + ')'; end ###添加留言 fq @@ -368,6 +368,10 @@ class User < Principal end end + def nickname(formatter = nil) + login + end + def name(formatter = nil) login end diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index c4a091299..5e02730c0 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -102,7 +102,7 @@ <% end %> - <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> + <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %> <%#=course.try(:teacher).try(:name)%> @@ -154,8 +154,7 @@ <%= course.school.name.try(:gsub, /(.+)$/, '\1:') %> - <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> - <%#=course.try(:teacher).try(:name)%> + <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
@@ -199,7 +198,6 @@ <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %> - <%#=course.try(:teacher).try(:name)%>