diff options
author | Jakob Odersky <jakob@odersky.com> | 2018-05-09 01:53:04 -0700 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2018-05-09 01:55:22 -0700 |
commit | f9533463cedcfee16177107932c64a444b269b85 (patch) | |
tree | 34327615088cf5106dcd81f33bd8884f34e68b62 /common/shared/src/main/scala/TextTemplates.scala | |
parent | 8ecae787ff7124b008229d958c579c73649dd9e4 (diff) | |
download | scala-triad-f9533463cedcfee16177107932c64a444b269b85.tar.gz scala-triad-f9533463cedcfee16177107932c64a444b269b85.tar.bz2 scala-triad-f9533463cedcfee16177107932c64a444b269b85.zip |
Add bootstrap and fancy UI
Diffstat (limited to 'common/shared/src/main/scala/TextTemplates.scala')
-rw-r--r-- | common/shared/src/main/scala/TextTemplates.scala | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/common/shared/src/main/scala/TextTemplates.scala b/common/shared/src/main/scala/TextTemplates.scala index 24a3b0e..e7e364a 100644 --- a/common/shared/src/main/scala/TextTemplates.scala +++ b/common/shared/src/main/scala/TextTemplates.scala @@ -6,6 +6,9 @@ object TextTemplates extends Templates(scalatags.Text) { def scripts(js: Boolean = true) = if (js) Seq( + div(id := "scalajs-error", style := "display: none;")( + "ScalaJS raised an exception. See the log for more information." + ), script(`type` := "text/javascript", src := "/assets/ui/js/ui-fastopt.js"), script(`type` := "text/javascript")( @@ -25,7 +28,7 @@ object TextTemplates extends Templates(scalatags.Text) { | triad.Main().main(root) | } catch(ex) { | // display warning message in case of exception - | //document.getElementById("scalajs-error").style.display = "block"; + | document.getElementById("scalajs-error").style.display = "block"; | throw ex; | } |}); @@ -36,7 +39,22 @@ object TextTemplates extends Templates(scalatags.Text) { else Seq.empty def page(messages: Seq[Message], js: Boolean = true) = html( - head(), + head( + link(rel := "stylesheet", + `type` := "text/css", + href := "/assets/lib/bootstrap-4.1.0/css/bootstrap-reboot.min.css"), + link(rel := "stylesheet", + `type` := "text/css", + href := "/assets/lib/bootstrap-4.1.0/css/bootstrap-grid.min.css"), + link(rel := "stylesheet", + `type` := "text/css", + href := "/assets/lib/bootstrap-4.1.0/css/bootstrap.min.css"), + link(rel := "stylesheet", + `type` := "text/css", + href := "/assets/main.css"), + meta(name := "viewport", + content := "width=device-width, initial-scale=1, shrink-to-fit=no") + ), body( conversation(messages), scripts(js) |