Just upgraded our project to Play! 2.2.1. After fixing dependencies, checking code, and fixing all initial compiler errors I went to launch the project and got the following:
')' expected but '}' found.
It occurs in 3 "view" files pointing to the last line of each file. Those 3 views are structured exactly the same as about 30 other files.
I've tried changing line delimiters, adding spacing to the top, etc. I also ran an sbt clean
as well as a play clean
. No idea. Here's a sample of an offending file:
Update: I removed the var userId = "%s";
and the format
below, and that file compiled. Any ideas how that's related?
@(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> </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> </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>
}
Really appreciate your help on this.