Permalink
Browse files

introduce SemanticUI

  • Loading branch information...
sadhen committed Jan 1, 2017
1 parent 4efc5fc commit 873948ea3012d09888f167a8cc561830d723c3ad
View
@@ -1,4 +1,6 @@
lazy val scalaV = "2.11.8"
lazy val jQueryV = "2.1.3"
lazy val semanticV = "2.2.2"
lazy val server = (project in file("server")).settings(
scalaVersion := scalaV,
@@ -12,6 +14,9 @@ lazy val server = (project in file("server")).settings(
"com.typesafe.play" %% "play-slick" % "2.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "2.0.0",
"com.vmunier" %% "scalajs-scripts" % "1.0.0",
"org.webjars" %% "webjars-play" % "2.5.0",
"org.webjars" % "Semantic-UI" % semanticV,
"org.webjars" % "jquery" % jQueryV,
specs2 % Test
),
// Compile the project before generating Eclipse files, so that generated .scala or .class files for views and routes are present
@@ -25,6 +30,10 @@ lazy val client = (project in file("client")).settings(
scalacOptions ++= Seq("-Xmax-classfile-name","78"),
persistLauncher in Test := false,
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full),
jsDependencies ++= Seq(
"org.webjars" % "jquery" % jQueryV / "jquery.js" minified "jquery.min.js",
"org.webjars" % "Semantic-UI" % semanticV / "semantic.js" minified "semantic.min.js" dependsOn "jquery.js"
),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.1",
"org.scala-lang.modules" % "scala-xml_2.11" % "1.0.6",
@@ -6,10 +6,10 @@ import play.api.libs.json.Json
import play.api.mvc._
import shared.SharedMessages
class Application @Inject() extends Controller {
class Application @Inject() (webJarAssets: WebJarAssets) extends Controller {
def index = Action {
Ok(views.html.index(SharedMessages.itWorks))
Ok(views.html.index(SharedMessages.itWorks, webJarAssets))
}
}
@@ -1,6 +1,6 @@
@(message: String)
@(message: String, webJarAssets: WebJarAssets)
@main("Play with Scala.js") {
@main("Play with Scala.js", webJarAssets) {
@scalajs.html.scripts("client",
routes.Assets.versioned(_).toString,
name => getClass.getResource(s"/public/$name") != null)
@@ -1,4 +1,4 @@
@(title: String)(content: Html)
@(title: String, webJarAssets: WebJarAssets)(content: Html)
<!DOCTYPE html>
@@ -7,6 +7,7 @@
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.versioned("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("images/favicon.png")">
<link rel='stylesheet' href='@routes.WebJarAssets.at(webJarAssets.locate("semantic.min.css"))'>
</head>
<body>
@content
View
@@ -9,3 +9,4 @@ GET / controllers.Application.index
GET /count controllers.CountController.count
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
GET /webjars/*file controllers.WebJarAssets.at(file)

0 comments on commit 873948e

Please sign in to comment.