From 7bf58894761742d4da8e6f52ce113ea7327e7114 Mon Sep 17 00:00:00 2001 From: Joris Date: Thu, 16 May 2019 09:40:02 +0200 Subject: Bootstrap --- client/src/view/View.scala | 22 ++++++++++++++++++++++ client/src/view/index/Index.scala | 27 +++++++++++++++++++++++++++ client/src/view/licence/LicencePage.scala | 24 ++++++++++++++++++++++++ client/src/view/notFound/NotFound.scala | 12 ++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 client/src/view/View.scala create mode 100644 client/src/view/index/Index.scala create mode 100644 client/src/view/licence/LicencePage.scala create mode 100644 client/src/view/notFound/NotFound.scala (limited to 'client/src/view') diff --git a/client/src/view/View.scala b/client/src/view/View.scala new file mode 100644 index 0000000..5c79a71 --- /dev/null +++ b/client/src/view/View.scala @@ -0,0 +1,22 @@ +package yoga.view + +import scala.xml.Node + +import yoga.router.Router + +object View { + + def apply(): Node = +
+
+ + YOGA + +
+ +
+ {Router.render()} +
+
+ +} diff --git a/client/src/view/index/Index.scala b/client/src/view/index/Index.scala new file mode 100644 index 0000000..29cb6ca --- /dev/null +++ b/client/src/view/index/Index.scala @@ -0,0 +1,27 @@ +package yoga.view.index + +import scala.xml.Node + +import yoga.model.Pose +import yoga.router.Router +import yoga.service.Poses + +object Index { + + def apply(): Node = +
+ {Poses.values.map(renderPose)} +
+ + def renderPose(pose: Pose): Node = + +
+ {pose.name} +
+
+ +
+
+ + +} diff --git a/client/src/view/licence/LicencePage.scala b/client/src/view/licence/LicencePage.scala new file mode 100644 index 0000000..fc76522 --- /dev/null +++ b/client/src/view/licence/LicencePage.scala @@ -0,0 +1,24 @@ +package yoga.view.licence + +import java.net.URI +import scala.xml.Node + +import yoga.service.Poses + +object LicencePage { + + def apply(uri: URI): Node = +
+ {Poses.values.find(_.image == uri).map { pose => +
+
+ +
+ + {pose.rights.licence.name} + +
+ }} +
+ +} diff --git a/client/src/view/notFound/NotFound.scala b/client/src/view/notFound/NotFound.scala new file mode 100644 index 0000000..a877640 --- /dev/null +++ b/client/src/view/notFound/NotFound.scala @@ -0,0 +1,12 @@ +package yoga.view.notFound + +import scala.xml.Node + +object NotFound { + + def apply(): Node = +
+ Page not found +
+ +} -- cgit v1.2.3