Not quite sure about this, but my guess would be the following: The @{ ... }
indicates the beginning of a dynamic statement and all of its content is treated as Scala code. Thus, it is a normal if-condition with two strings as a result, both of which are simply returned in the template.
Why are you marking it as a multi-line code block anyway? Have you tried it like this? (note the missing curly braces after the 2nd @
sign):
@navItem(label: String, link1: String) = {
@if(Application.isAuthenticated()) {
<li class="active">
<a href="@link1">@label</a>
</li>
} else {
<li class="disabled">
<a href="@link1">@label</a>
</li>
}
}