Skip to content

Commit e1d1069

Browse files
committed
Add support for path to custom bootstrap css file
1 parent db46f2c commit e1d1069

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

module-code/app/securesocial/core/services/RoutesService.scala

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ trait RoutesService {
2929
def authenticationUrl(provider: String, redirectTo: Option[String] = None)(implicit req: RequestHeader): String
3030
def faviconPath: Call
3131
def jqueryPath: Call
32+
def bootstrapCssPath: Call
3233
def customCssPath: Option[Call]
3334
}
3435

@@ -43,9 +44,11 @@ object RoutesService {
4344

4445
val FaviconKey = "securesocial.faviconPath"
4546
val JQueryKey = "securesocial.jqueryPath"
47+
val BootstrapCssKey = "securesocial.bootstrapCssPath"
4648
val CustomCssKey = "securesocial.customCssPath"
4749
val DefaultFaviconPath = "images/favicon.png"
4850
val DefaultJqueryPath = "javascripts/jquery-1.7.1.min.js"
51+
val DefaultBootstrapCssPath = "bootstrap/css/bootstrap.min.css"
4952

5053
protected def absoluteUrl(call: Call)(implicit req: RequestHeader): String = {
5154
call.absoluteURL(IdentityProvider.sslEnabled)
@@ -85,6 +88,11 @@ object RoutesService {
8588
*/
8689
override val jqueryPath = valueFor(JQueryKey, DefaultJqueryPath)
8790

91+
/**
92+
* Loads the Bootstrap CSS file to use from configuration, using a default one if not provided
93+
* @return the path to Bootstrap CSS file to use
94+
*/
95+
override val bootstrapCssPath = valueFor(BootstrapCssKey, DefaultBootstrapCssPath)
8896
/**
8997
* Loads the Custom Css file to use from configuration. If there is none define, none will be used
9098
* @return Option containing a custom css file or None

module-code/app/securesocial/views/main.scala.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<html>
66
<head>
77
<title>@title</title>
8-
<link rel="stylesheet" media="screen" href="@securesocial.controllers.routes.Assets.at("bootstrap/css/bootstrap.min.css")">
8+
<link rel="stylesheet" media="screen" href="@env.routes.bootstrapCssPath">
99
<link rel="shortcut icon" type="image/png" href="@env.routes.faviconPath">
1010
@env.routes.customCssPath.map { customPath =>
1111
<link rel="stylesheet" media="screen" href="@customPath">

0 commit comments

Comments
 (0)