@(providerId: String, loginForm: Option[play.api.data.Form[(String, String)]] = None)(implicit request: play.api.mvc.RequestHeader) @import securesocial.core.Registry @import securesocial.core.IdentityProvider @import securesocial.core.providers.UsernamePasswordProvider @import securesocial.core.AuthenticationMethod._ @import securesocial.core.providers.utils.RoutesHelper @import play.api.Logger @import helper._ @implicitFieldConstructor = @{ FieldConstructor(securesocial.views.html.inputFieldConstructor.f) } @Registry.providers.get(providerId).map { provider => @if( provider.authMethod == OAuth1 || provider.authMethod == OAuth2 ) { @defining( "securesocial/images/providers/%s.png".format(provider.id) ) { imageUrl => } } @if( provider.authMethod == UserPassword ) {
@if( UsernamePasswordProvider.withUserNameSupport ) { @helper.inputText( loginForm.get("username"), '_label -> Messages("securesocial.signup.username"), 'class -> "input-xlarge" ) } else { @helper.inputText( loginForm.get("username"), '_label -> Messages("securesocial.signup.email1"), 'class -> "input-xlarge" ) } @helper.inputPassword( loginForm.get("password"), '_label -> Messages("securesocial.signup.password1"), 'class -> "input-xlarge" )

@Messages("securesocial.login.signUp") @Messages("securesocial.login.here")

} }.getOrElse { @***************************************** * Todo: throw a runtime exception? this might need improvement *****************************************@ @Logger.error("[securesocial] unknown provider '%s'. Can't render it.".format(providerId)) { throw new RuntimeException("Unknown provider '%s') } }