I have a menu child item that is only displayed when a user is logged in. If logged in and user clicks this item I want to open a new page and display user's eula that they agreed to via rest endpoint. Endpoint requires user id which is stored in session var on login.
My solution works in Safari and Chrome but fails in IE due to nest anchors (they only nest in IE).
My solution was:
val eulaLoc = Loc("UserEula", "userEula" :: Nil, eulaLink("menu.eula"), loggedIn)
where
def eulaLink(dflt: String): NodeSeq = {
val eula = for {
user <- UserService.currentUser
id <- user._id
dest = s"api/eula/${id}"
} yield <a href={dest} target="_blank">{S.loc(dflt, Text(dflt))}</a>
eula match {
case Full(ref) => ref
case _ => NodeSeq.Empty
}
}
I have tried using text for name and ExtLoc for Link but this only instantiates ExtLoc once and not per session - which I understand purpose of.
I have tried calling my own new Link to create a null link or simple span element and not an anchor element to no avail
def span() = new Loc.Link[Unit](Nil, false) {
override def createLink(value: Unit): Box[NodeSeq] = Full(<span></span>)
}
val eulaLoc = Loc("UserEula", span(), eulaLink("menu.eula"), loggedIn)
What I have: <li><a href=""></a><a href="api/eula/54d4cf342f1e3fe899f6c6e5" target="_blank">EULA</a></li>
What I want: <li><a href="api/eula/54d4cf342f1e3fe899f6c6e5" target="_blank">EULA</a></li>
Appreciate suggestions.