]> git.openstreetmap.org Git - rails.git/commitdiff
Don't try and display IP address for users without one
authorTom Hughes <tom@compton.nu>
Fri, 7 May 2010 08:29:38 +0000 (09:29 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 7 May 2010 08:29:38 +0000 (09:29 +0100)
app/views/user/_user.html.erb
config/locales/en.yml

index 2779f87623facc82c2b41a5544064961d47c033f..bbc89f965b6a1224542068192b4580849d781724 100644 (file)
@@ -6,11 +6,18 @@
   </td>
   <td>
     <p>
   </td>
   <td>
     <p>
-      <%= 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 %>
     </p>
     <%= htmlize(user.description) %>
   </td>
     </p>
     <%= htmlize(user.description) %>
   </td>
index b7513a0f251ba7ffc6430fa8736863227f9657a4..9775416e42f204d03eeeb0416079529ab1123319 100644 (file)
@@ -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}}"
         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
       confirm: Confirm Selected Users
       hide: Hide Selected Users
       empty: No matching users found