]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/application_helper.rb
Fixup some error handling in map bugs
[rails.git] / app / helpers / application_helper.rb
index c5df676757d1ca761f13453a463aaf16f67eee5d..7a4953f0ffdf79c835efb6c428474101f1f75178 100644 (file)
@@ -49,6 +49,26 @@ module ApplicationHelper
     end
   end
 
+  def user_image(user, options = {})
+    options[:class] ||= "user_image"
+
+    if user.image
+      image_tag url_for_file_column(user, "image"), options
+    else
+      image_tag "anon_large.png", options
+    end
+  end
+
+  def user_thumbnail(user, options = {})
+    options[:class] ||= "user_thumbnail"
+
+    if user.image
+      image_tag url_for_file_column(user, "image"), options
+    else
+      image_tag "anon_small.png", options
+    end
+  end
+
 private
 
   def javascript_strings_for_key(key)