diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0c2b6edc3a38c7008bd79b2400dcf8d1363b7a15..3b6b19e35b8a70529708adf9b448596372ce5715 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -55,7 +55,7 @@ module ApplicationHelper # Display a link to user's account page def link_to_user(user) - link_to user.display_name, :controller => 'account', :action => 'show', :id => user + link_to user.name, :controller => 'account', :action => 'show', :id => user end def link_to_issue(issue) diff --git a/app/models/member.rb b/app/models/member.rb index 7b512de379c84e5132e28b0918d5bfe5ed8ca83b..2aa26d42f3a61eed7c2f855f283bf70f4a601f7c 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -24,7 +24,7 @@ class Member < ActiveRecord::Base validates_uniqueness_of :user_id, :scope => :project_id def name - self.user.display_name + self.user.name end def before_destroy diff --git a/app/models/user.rb b/app/models/user.rb index 569233d53055c030c4442d8ef13a5128bbd173f2..a017b42898127047a7fe6339e9acd02ed9000cf0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -101,12 +101,8 @@ class User < ActiveRecord::Base end # Return user's full name for display - def display_name - firstname + " " + lastname - end - def name - display_name + "#{firstname} #{lastname}" end def active? diff --git a/app/views/account/show.rhtml b/app/views/account/show.rhtml index 80614895dabce9aac20235f91d44a0bae1549d33..4f1bf45e282e0bc12b83097f75257470bb47eff1 100644 --- a/app/views/account/show.rhtml +++ b/app/views/account/show.rhtml @@ -1,4 +1,4 @@ -<h2><%= @user.display_name %></h2> +<h2><%=h @user.name %></h2> <p> <%= mail_to @user.mail unless @user.pref.hide_mail %> diff --git a/app/views/attachments/_links.rhtml b/app/views/attachments/_links.rhtml index 93d6b2a7da7d6528e707d3d39e3ca07f63ead171..afae91a7bc999b9a8e2d6eee62046f6e028ed281 100644 --- a/app/views/attachments/_links.rhtml +++ b/app/views/attachments/_links.rhtml @@ -3,7 +3,7 @@ <p><%= link_to attachment.filename, {:controller => 'attachments', :action => 'download', :id => attachment }, :class => 'icon icon-attachment' %> (<%= number_to_human_size attachment.filesize %>) <% unless options[:no_author] %> - <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em> + <em><%= attachment.author.name %>, <%= format_date(attachment.created_on) %></em> <% end %> <% if options[:delete_url] %> <%= link_to image_tag('delete.png'), options[:delete_url].update({:attachment_id => attachment}), :confirm => l(:text_are_you_sure), :method => :post %> diff --git a/app/views/documents/show.rhtml b/app/views/documents/show.rhtml index 4bf09f3dd5e150e77308c95e44272b33772e1c1d..2dc76ead61a37bac467e47a26fe0ec3e35384fb5 100644 --- a/app/views/documents/show.rhtml +++ b/app/views/documents/show.rhtml @@ -19,7 +19,7 @@ </div> <%= link_to attachment.filename, :action => 'download', :id => @document, :attachment_id => attachment %> (<%= number_to_human_size attachment.filesize %>)<br /> - <em><%= attachment.author.display_name %>, <%= format_date(attachment.created_on) %></em><br /> + <em><%= attachment.author.name %>, <%= format_date(attachment.created_on) %></em><br /> <%= lwr(:label_download, attachment.downloads) %> </li> <% end %> diff --git a/app/views/mailer/_issue.rhtml b/app/views/mailer/_issue.rhtml index bf17132e66fadd4de81f418caa6e9be63db20bed..7caf855fe59b418110816264d9a27d806fe8be85 100644 --- a/app/views/mailer/_issue.rhtml +++ b/app/views/mailer/_issue.rhtml @@ -1,5 +1,5 @@ <%=l(:label_issue)%> #<%= issue.id %> - <%= issue.subject %> -<%=l(:field_author)%>: <%= issue.author.display_name %> +<%=l(:field_author)%>: <%= issue.author.name %> <%=l(:field_assigned_to)%>: <%= issue.assigned_to ? issue.assigned_to.name : "-" %> <%=l(:field_status)%>: <%= issue.status.name %> diff --git a/app/views/news/show.rhtml b/app/views/news/show.rhtml index 30e746aefdaf35e0d30239b0b01b7377d8e8b4ec..df3c02799fc63693fea516bbd0207032139344e9 100644 --- a/app/views/news/show.rhtml +++ b/app/views/news/show.rhtml @@ -6,7 +6,7 @@ <h2><%=h @news.title %></h2> <p><em><% unless @news.summary.empty? %><%=h @news.summary %><br /><% end %> -<%= @news.author.display_name %>, <%= format_time(@news.created_on) %></em></p> +<%= @news.author.name %>, <%= format_time(@news.created_on) %></em></p> <br /> <%= textilizable(@news.description) %> <br /> diff --git a/app/views/projects/_members.rhtml b/app/views/projects/_members.rhtml index 01430d19b6b140c1deb4de1389e89be251aa4e1e..1924e430a0d5fbcd64dff1a51af48c45eee7e75a 100644 --- a/app/views/projects/_members.rhtml +++ b/app/views/projects/_members.rhtml @@ -12,7 +12,7 @@ <% @project.members.find(:all, :include => [:role, :user]).sort{|x,y| x.role.position <=> y.role.position}.each do |member| %> <% next if member.new_record? %> <tr class="<%= cycle 'odd', 'even' %>"> - <td><%= member.user.display_name %></td> + <td><%= member.name %></td> <td align="center"> <% if authorize_for('members', 'edit') %> <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, :method => :post) do |f| %> diff --git a/app/views/projects/list_members.rhtml b/app/views/projects/list_members.rhtml index c4d3ec466d79d899c52aa1d24ea198e824a118e3..fcfb4f7c0dcec245b15c3c2a0c3932521422105f 100644 --- a/app/views/projects/list_members.rhtml +++ b/app/views/projects/list_members.rhtml @@ -7,7 +7,7 @@ <h3><%= role.name %></h3> <ul> <% members[role].each do |m| %> -<li><%= link_to m.user.display_name, :controller => 'account', :action => 'show', :id => m.user %> (<%= format_date m.created_on %>)</li> +<li><%= link_to m.name, :controller => 'account', :action => 'show', :id => m.user %> (<%= format_date m.created_on %>)</li> <% end %> </ul> <% end %>