]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/user_helper.rb
Replace openID.js with funky rails generated javascript
[rails.git] / app / helpers / user_helper.rb
index 0147c3fe6aabbf787808646d70952bb2f0bf1eed..eb2b34e9066ec59e1419a959bcfe995d6803ecf8 100644 (file)
@@ -1,2 +1,12 @@
 module UserHelper
+  def openid_button(name, url)
+    link_to_function(
+      image_tag("#{name}.png", :alt => t("user.login.openid_providers.#{name}.alt")),
+      nil,
+      :title => t("user.login.openid_providers.#{name}.title")      
+    ) do |page|
+      page[:login_form][:user_openid_url][:value] = url
+      page[:login_form].submit()
+    end
+  end
 end