1

プロジェクトを Play にアップグレードしました。2.2.1. 依存関係を修正し、コードをチェックし、最初のコンパイラ エラーをすべて修正した後、プロジェクトを立ち上げたところ、次の結果が得られました。

')' expected but '}' found.

これは、各ファイルの最後の行を指す 3 つの「ビュー」ファイルで発生します。これら 3 つのビューは、他の約 30 個のファイルとまったく同じ構造になっています。

行区切り記号を変更したり、先頭にスペースを追加したりしてみましsbt 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