Commit 9935641a authored by Eva Gächter's avatar Eva Gächter

frontend using bootstrap 4 and sass

parent 12305f87
import play.sbt.PlayImport.PlayKeys.devSettings
import sbt.Project.projectToRef
import org.irundaia.sbt.sass._
lazy val uploadsFolder: String =
(file(".") / "data" / "uploads").getAbsoluteFile.getAbsolutePath
......@@ -40,11 +41,11 @@ lazy val server = (project in file("server"))
scalacOptions ++= Seq("-Xmax-classfile-name", "100"),
// Root Path for included CSS in main.less
LessKeys.rootpath := "/",
SassKeys.assetRootURL := "/",
// Adjust Urls imported in main.less
LessKeys.relativeUrls := true,
// LessKeys.relativeUrls := true,
// compress CSS
LessKeys.compress in Assets := true,
// LessKeys.compress in Assets := true,
maintainer in Docker := "insign gmbh <info@insign.ch>",
packageName in Docker := "demo",
......
......@@ -52,8 +52,8 @@ object Settings {
val flexSlider = "2.2.2"
val jqueryForm = "3.51"
val jqueryUI = "1.10.3"
val jQuery = "1.10.2"
val bootstrap = "3.3.2"
val jQuery = "3.3.1"
val bootstrap = "4.2.1"
val playScripts = "1.1.1"
val fontAwesome = "4.7.0"
}
......@@ -111,7 +111,7 @@ object Settings {
/** Dependencies for external JS libs that are bundled into a single .js file according to dependency order */
val jsDependencies = Def.setting(Seq(
"org.webjars" % "jquery" % versions.jQuery / "jquery.js" minified "jquery.min.js",
"org.webjars" % "bootstrap" % versions.bootstrap / "bootstrap.js" minified "bootstrap.min.js" dependsOn "jquery.js",
"org.webjars" % "bootstrap" % versions.bootstrap / "bootstrap.bundle.js" minified "bootstrap.bundle.min.js" dependsOn "jquery.js",
"org.webjars" % "log4javascript" % versions.log4js / "js/log4javascript_uncompressed.js" minified "js/log4javascript.js",
"org.webjars" % "FlexSlider" % versions.flexSlider / "jquery.flexslider.js" minified "jquery.flexslider-min.js",
"org.webjars" % "jquery-form" % versions.jqueryForm / "jquery.form.js",
......
......@@ -10,7 +10,8 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.15")
addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "2.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2")
//addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2")
addSbtPlugin("org.irundaia.sbt" % "sbt-sassify" % "1.4.11")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
addSbtPlugin("com.vmunier" % "sbt-web-scalajs" % "1.0.7")
addSbtPlugin("ch.insign" %% "sbt-dev-module" % "1.0.4")
......
@import (less) "lib/jquery-ui/themes/base/minified/jquery-ui.min.css";
@import (less) "lib/font-awesome/less/font-awesome";
@fa-font-path: "/lib/font-awesome/fonts";
@fa-css-prefix: fa;
@import (less) "lib/FlexSlider/flexslider.css";
@import "lib/bootstrap/less/bootstrap";
@icon-font-path: "/lib/bootstrap/fonts/";
@import (less) "lib/play-cms/frontend/css/sortable.css";
@import (less) "lib/play-cms/frontend/css/main.css";
@import (inline) "lib/play-cms/frontend/css/slider.css";
img {
display: block;
max-width: 100%;
height: auto;
}
// Link more Less files like this
//@import "server/app/assets/stylesheets/XYZ";
// Your LESS code goes here
@import "lib/jquery-ui/themes/base/minified/jquery-ui.min";
$fa-font-path: "/lib/font-awesome/fonts";
$fa-css-prefix: fa;
@import "lib/font-awesome/scss/font-awesome.scss";
@import "lib/FlexSlider/flexslider";
@import "base/_variables.scss";
@import "lib/bootstrap/scss/bootstrap.scss";
@import "lib/play-cms/frontend/css/sortable";
@import "lib/play-cms/frontend/css/main";
@import "lib/play-cms/frontend/css/slider";
img {
display: block;
max-width: 100%;
height: auto;
}
......@@ -38,7 +38,7 @@
<!-- Link compiled less files from app/assets/stylesheets/ -->
<!-- CSS Libraries from play-cms get imported there as well -->
<link rel="stylesheet" media="screen" href=@_asset("stylesheets/main.min.css") >
<link rel="stylesheet" media="screen" href=@_asset("stylesheets/main.css") >
<link rel="stylesheet" media="screen" href=@_webjarAsset("bootstrap-modal/css/bootstrap-modal.css") >
</head>
......@@ -124,6 +124,18 @@
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
@if(page.getKey == PageBlock.KEY_HOMEPAGE) {
@Template.addBlockByKey(classOf[SliderCollectionBlock], "slider").cached
}
......@@ -141,15 +153,16 @@
@* INFO: Include this if you want to use default javascriptRoutes instead of ScalaJs-autowire functionality *@
<script src="@{ch.insign.cms.controllers.routes.ApplicationController.javascriptRoutes}"></script>
@* remove this if you don't use scala-js for asset-management and do it conventionally by providing script-tags to your resources here *@
@scalajs.html.scripts(projectName = "client", routes.Assets.versioned(_).toString, name => getClass.getResource(s"/public/$name") != null)
@* TODO: integrate those scripts into scala-js code *@
<script src="@{ch.insign.cms.views.html.tags._asset("frontend/js/login.js")}"></script>
<script src="@{ch.insign.cms.views.html.tags._asset("javascripts/blocks.js")}"></script>
<script src="@{ch.insign.cms.views.html.tags._asset("frontend/js/sortable.js")}"></script>
<script src="@{ch.insign.cms.views.html.tags._asset("frontend/js/main.js")}"></script>
@* Javascript Config object for libraries in use (parsable template, Message halepers can be used to translate initObjectValues) *@
<script src="/javascripts/config" type="text/javascript"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment