diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index ed27d938..2f642f54 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -209,7 +209,7 @@ private end def read_authorize - if @attachment.container_type == "HomeworkAttach" + if @attachment.container_type == "HomeworkAttach" || @attachment.container_type == 'Bid' true #User.current.allowed_to?(:view_homework_attaches, @attachment.project) ? true : deny_access else diff --git a/app/models/user.rb b/app/models/user.rb index e5465827..41681ded 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/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb index ce24a445..e987dca5 100644 --- a/app/views/bids/_list_projects.html.erb +++ b/app/views/bids/_list_projects.html.erb @@ -176,7 +176,7 @@
diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb
index a6403842..4feddc67 100644
--- a/app/views/projects/_project.html.erb
+++ b/app/views/projects/_project.html.erb
@@ -72,11 +72,9 @@
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
-
-
<% @admin = @project.project_infos%>
<% if @admin.size > 0 %>
- <%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
+ <%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %>
<% if(@project.project_type==1)%>
<%= l(:label_course_college) %>:
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index c4a09129..5e02730c 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)) %>