Layout

io.eezo.http.Layout
See theLayout companion object
trait Layout

The one frame every HTML reply comes back in.

One per application, named in Main beside the routes, so that a nav, a stylesheet or a sign out form is written once and reaches every page, the derived ones, the login page and the error page included, without any route asking for it. A route returns content and the frame is put around it; a route that returns a whole document, an html element at its root, steps outside the frame and goes out as written.

title is the text of the first title element the route wrote beside its content, lifted out before the call, because the title is a fact about the page and the head it belongs in is the layout's. It arrives as plain text, None when the route wrote none. The result runs from html down: the framework prepends the doctype, so a layout cannot forget it.

The request is there so that the frame can depend on who is asking, a sign in link or a sign out form. It is the request as it arrived, its session read, and it does not see what the reply does to the session: a page that signs somebody in is framed as the anonymous request it was. A first visit, an error page and a request that matched no route carry no CSRF token yet, so a frame that asks for one there throws, and a frame that throws is answered as a 500 in plain.

Attributes

Companion
object
Source
Layout.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def apply(request: Request, title: Option[String], content: Html): Html

Attributes

Source
Layout.scala