0

我正在尝试将此播放身份验证模块与我的应用程序的移动端集成。我想为每个页面使用 JQuery mobile 而不是 Twitter Bootstrap。所以我创建了一个单独的视图,我刚刚设置了一个基本索引,我试图让登录页面首先工作。登录页面以表单为参数,我只是想知道是否有办法在 JQuery Mobile 中使用 scala 表单助手在 play 2.0.* 中。

到目前为止我的基本登录页面:

@(loginForm: Form[_])

@import helper._

@main(Messages("playauthenticate.login.title"),"login") {
            <div data-role="content">
                <div data-role="fieldcontain">
                    <label for="textinput1">
                        Your Email
                    </label>
                    <input name="" id="textinput1" placeholder="" value="" type="email" />
                </div>
                <div data-role="fieldcontain">
                    <label for="textinput2">
                        Your Password
                    </label>
                    <input name="" id="textinput2" placeholder="" value="" type="password" />
                </div>
                <a data-role="button" href="#page1">
                    Login Now
                </a>
                <h4>
                    Or login with a different service:
                </h4>
                      @* Display list of available providers *@
                      @_providerPartial(skipCurrent=false)
                <a data-role="button" data-transition="slidedown" href="routes.Application.index()">
                    Home
                </a>
            </div>
}

就是使用 Twitter Bootstrap 的样子。

4

1 回答 1

2

Yes and... no.

As you showed us jQueryMobile has its specific markup for form, so built-in helpers of Play doesn't fit it in any way...

You have two solutions and choice between this you want to use belongs to you:

  • If you have just few forms, write them with common HTML according to JQM's specification.
  • Otherwise, if you plan to use lot of forms in many places you'll do better if you'll... write own field constructors.

Of course if you'll decide to go with second approach it will be great if you'll decide to share it with others :)

于 2013-04-17T19:29:24.497 回答