Skip to content

Commit 0582699

Browse files
committed
Merge pull request jaliss#489 from tro2102/master
Add support for path to custom bootstrap css file
2 parents 8fda175 + e1d1069 commit 0582699

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
@@ -90,6 +90,7 @@ trait RoutesService {
9090
def authenticationUrl(provider: String, redirectTo: Option[String] = None)(implicit req: RequestHeader): String
9191
def faviconPath: Call
9292
def jqueryPath: Call
93+
def bootstrapCssPath: Call
9394
def customCssPath: Option[Call]
9495
}
9596

@@ -104,9 +105,11 @@ object RoutesService {
104105

105106
val FaviconKey = "securesocial.faviconPath"
106107
val JQueryKey = "securesocial.jqueryPath"
108+
val BootstrapCssKey = "securesocial.bootstrapCssPath"
107109
val CustomCssKey = "securesocial.customCssPath"
108110
val DefaultFaviconPath = "images/favicon.png"
109111
val DefaultJqueryPath = "javascripts/jquery-1.7.1.min.js"
112+
val DefaultBootstrapCssPath = "bootstrap/css/bootstrap.min.css"
110113

111114
protected def absoluteUrl(call: Call)(implicit req: RequestHeader): String = {
112115
call.absoluteURL(IdentityProvider.sslEnabled)
@@ -182,6 +185,11 @@ object RoutesService {
182185
*/
183186
override val jqueryPath = valueFor(JQueryKey, DefaultJqueryPath)
184187

188+
/**
189+
* Loads the Bootstrap CSS file to use from configuration, using a default one if not provided
190+
* @return the path to Bootstrap CSS file to use
191+
*/
192+
override val bootstrapCssPath = valueFor(BootstrapCssKey, DefaultBootstrapCssPath)
185193
/**
186194
* Loads the Custom Css file to use from configuration. If there is none define, none will be used
187195
* @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)