1

刚刚将我们的项目升级为 Play!2.2.1。在修复依赖关系、检查代码并修复所有初始编译器错误之后,我开始启动项目并得到以下结果:

')' expected but '}' found.

它出现在 3 个“视图”文件中,指向每个文件的最后一行。这 3 个视图的结构与大约 30 个其他文件完全相同。

我尝试过更改行分隔符、在顶部添加间距等。我还运行了 ansbt cleanplay clean. 不知道。这是一个违规文件的示例:

更新:我删除了var userId = "%s";下面的format,并编译了该文件。任何想法这是如何相关的?

@(session:play.api.mvc.Session, socialUser: Option[PlatformUser], userProfile: Option[UserProfile], flash:play.api.mvc.Flash)(implicit request: RequestHeader)

@import platform3.util.time.TimeFormats._

@main(session, models.Community.communitySettings(request), "Thanks for signing up!", socialUser, flash, """

  /* injected javascript */
  var userId = "%s";

  $.getJSON("/balance", function(data) {
    $('#title-points').text(data.balance);
    $('.label-points').show();
  });

""" format socialUser.getOrElse("")) {

  <section id="page-title">
    <div class="container">
      <div class="row">
        <div class="span12 text-center">
          <h3>Welcome!</h3>
        </div>
      </div>
    </div>
  </section>


  <section class="featured">
    <div class="featured-text hero-img thanks-img">
      <div class="container">
        <h2><span class="featured-text-bg">You're signed up!</span></h2>
      @socialUser match{
        case Some(u) => {
        <h3><span class="featured-text-bg">Hey @u.firstName, we're excited you</span><br>
        <span class="featured-text-bg">could join us. Click below to</span><br>
        <span class="featured-text-bg">see how you can get started.</span>
        </h3>
        }
        case None => {}
      }
        <div class="sc-button-group">
          <a href="/earn" class="btn btn-large btn-rounded btn-theme"><i class="icon-star icon-large"></i> Earn Points</a>
          <a href="/account" class="btn btn-large btn-rounded">My Account</a>
        </div>
      </div>
    </div>
  </section>

  <section id="content2">
    <div class="container">
      <div class="row margin-30">
        <div class="span9 margin-30">
          <h2 style="color:#626c72" class="margin-20">Your current point balance is <strong><span id="title-points"></span>pts</strong>.</h2>
          <p class="lead">Earning more points is easy! Get involved and earn more rewards quickly.</p>
          <p><b>Visit us</b> in person and sign in to our on-site kiosks.<br>
            <b>Share our content</b> and your experiences across the web and earn more points.</p>
          <p>&nbsp;</p>
          <p><a href="/earn" class="btn btn-large btn-rounded btn-theme"><i class="icon-star icon-large"></i> Earn Points</a>
            <a href="/account" class="btn btn-large btn-rounded">View My Account</a></p>
          <p>&nbsp;</p>
          <p><small>Maximum of 2,500 points can be earned per month per person. Points must be redeemed before midnight of December 31st of each year.</small></p>
        </div>
        <div class="span3 margin-30">
          <p>Earn even more points by connecting your social accounts.</p>
          <p><a href="/connect/facebook"><img src="/assets/img/connect-facebook.jpg" /></a></p>
          <p><a href="/connect/twitter"><img src="/assets/img/connect-twitter.jpg" /></a></p>
          <p><a href="/connect/instagram"><img src="/assets/img/connect-instagram.jpg" /></a></p>
        </div>
      </div>
    </div>
  </section>

}

非常感谢您对此的帮助。

4

0 回答 0