I'm trying to customize the view propose by the module "securesocial" with play 2
What I've already done is :
1/ Create a new plugin name SecureViewsPlugin that implements the TemplatesPlugin under "controllers/SecuresViewsPlugin.scala"
package controllers
import play.api.mvc.{RequestHeader, Request}
import play.api.templates.Html
import securesocial.controllers.Registration.RegistrationInfo
import securesocial.controllers.TemplatesPlugin
import securesocial.core.{SecuredRequest, SocialUser}
import play.api.data.Form
import securesocial.core.SecureSocial._
import securesocial.controllers.PasswordChange.ChangeInfo
class SecureViewsPlugin(application: App) extends TemplatesPlugin {
override def getLoginPage[A](implicit request: Request[A], form: Form[(String, String)],
msg: Option[String] = None): Html =
{
views.html.secure.login(form, msg)
}
override def getSignUpPage[A](implicit request: Request[A], form: Form[RegistrationInfo], token: String): Html = {
views.html.secure.Registration.signUp(form, token)
}
(..)
2/ I updated the file play.plugins with :
1500:com.typesafe.plugin.CommonsMailerPlugin
9996:securesocial.core.providers.utils.DefaultPasswordValidator
9997:controllers.SecureViewsPlugin
3/ I made a copy a the different view in the folder "views/secure"
/Views
/secure
/inputFieldConstructor.scala.html
/login.scala.html
/(...)
Here is the begining of the error I always get
not found: type RequestHeader
In app/views/secure/login.scala.html at line 0.
->@(loginForm: Form[(String,String)], errorMsg: Option[String] = None)(implicit request: RequestHeader)
[error] /Users/clementaubert/Desktop/demo/target/scala-2.9.1/src_managed/main/views/html/secure/login.template.scala:24: not found: type RequestHeader
[error] object login extends BaseScalaTemplate[play.api.templates.Html,Format[play.api.templates.Html]](play.api.templates.HtmlFormat) with play.api.templates.Template3[Form[scala.Tuple2[String, String]],Option[String],RequestHeader,play.api.templates.Html] {
[error] ^
[error] /Users/clementaubert/Desktop/demo/target/scala-2.9.1/src_managed/main/views/html/secure/login.template.scala:27: not found: type RequestHeader
[error] def apply/*1.2*/(loginForm: Form[(String,String)], errorMsg: Option[String] = None)(implicit request: RequestHeader):play.api.templates.Html = {
[error] ^
[error] /Users/clementaubert/Desktop/demo/app/controllers/SecureViewsPlugin.scala:18: type mismatch;
[error] found : play.api.data.Form[(String, String)]
[error] required: play.data.Form[(java.lang.String, java.lang.String)]
[error] views.html.secure.login(form, msg)
[error]
login.scala.html
I tried to delete "(implicit request: RequestHeader)" but then I got this error
type mismatch; found : play.api.data.Form[(String, String)] required: play.data.Form[(java.lang.String, java.lang.String)]
I'm guessing I'm not doing it the right way.
I can't figure out why I'm getting these errors