From 72118727904ca4b34ea8f63c40f2701782d93284 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 7 May 2010 09:29:38 +0100 Subject: [PATCH] Don't try and display IP address for users without one --- app/views/user/_user.html.erb | 17 ++++++++++++----- config/locales/en.yml | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/views/user/_user.html.erb b/app/views/user/_user.html.erb index 2779f8762..bbc89f965 100644 --- a/app/views/user/_user.html.erb +++ b/app/views/user/_user.html.erb @@ -6,11 +6,18 @@

- <%= t 'user.list.summary', - :name => link_to(h(user.display_name), :action => "view", :display_name => user.display_name), - :ip_address => link_to(user.creation_ip, :ip => user.creation_ip), - :date => l(user.creation_time, :format => :friendly) - %> + <% if user.creation_ip %> + <%= t 'user.list.summary', + :name => link_to(h(user.display_name), :action => "view", :display_name => user.display_name), + :ip_address => link_to(user.creation_ip, :ip => user.creation_ip), + :date => l(user.creation_time, :format => :friendly) + %> + <% else %> + <%= t 'user.list.summary_no_ip', + :name => link_to(h(user.display_name), :action => "view", :display_name => user.display_name), + :date => l(user.creation_time, :format => :friendly) + %> + <% end %>

<%= htmlize(user.description) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index b7513a0f2..9775416e4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1651,6 +1651,7 @@ en: one: Showing page {{page}} ({{first_item}} of {{items}}) other: Showing page {{page}} ({{first_item}}-{{last_item}} of {{items}}) summary: "{{name}} created from {{ip_address}} on {{date}}" + summary_no_ip: "{{name}} created on {{date}}" confirm: Confirm Selected Users hide: Hide Selected Users empty: No matching users found -- 2.39.5