Permalink
Browse files

Changed from "views" to "pages" to get around precompilation issue.

  • Loading branch information...
Matt Raible
Matt Raible committed Feb 8, 2012
1 parent 75889ba commit c90b41fd3afe1b4be759dfc0520a837787713a07
Showing with 11 additions and 8 deletions.
  1. +5 −2 conf/dependencies.yml
  2. +6 −6 src/play/modules/scalate/ScalateTemplate.scala
View
@@ -1,4 +1,4 @@
-self: play -> scalate 0.2
+self: play -> scalate 0.2.5
require:
- play
@@ -8,4 +8,7 @@ require:
- javax.servlet -> *
- com.sun.jersey -> *
- org.osgi -> *
- - org.fusesource.scalate -> scalate-util 1.5.3-scala_2.8.2
+ - org.scala-lang -> *
+ - org.fusesource.scalate -> scalate-util 1.5.3-scala_2.8.2:
+ exclude:
+ - org.scala-lang -> *
@@ -18,13 +18,13 @@ object ScalateTemplate {
lazy val scalateEngine = {
val engine = new TemplateEngine
- engine.resourceLoader = new FileResourceLoader(Some(Play.getFile("/app/views")))
+ engine.resourceLoader = new FileResourceLoader(Some(Play.getFile("/app/pages")))
engine.classpath = Play.getFile("/tmp/classes").getAbsolutePath
engine.workingDirectory = Play.getFile("tmp")
engine.combinedClassPath = true
engine.classLoader = Play.classloader
engine.layoutStrategy = new DefaultLayoutStrategy(engine,
- Play.getFile("/app/views/layouts/default" + scalateType).getAbsolutePath)
+ Play.getFile("/app/pages/layouts/default" + scalateType).getAbsolutePath)
engine.bindings = List(
Binding("context", SourceCodeHelper.name(classOf[DefaultRenderContext]), true)
@@ -43,8 +43,8 @@ object ScalateTemplate {
try {
val baseName = name.replaceAll(".html","") // for when Template() is used instead of render
- val templatePath = new File(Play.applicationPath+"/app/views","/"+baseName).toString
- .replace(new File(Play.applicationPath+"/app/views").toString,"")
+ val templatePath = new File(Play.applicationPath+"/app/pages","/"+baseName).toString
+ .replace(new File(Play.applicationPath+"/app/pages").toString,"")
scalateEngine.layout(templatePath + scalateType, argsMap)
} catch {
case ex:TemplateNotFoundException => {
@@ -107,8 +107,8 @@ object ScalateTemplate {
}
private def errorTemplate:String = {
- val fullPath = new File(Play.applicationPath,"/app/views/errors/500.scaml").toString
- fullPath.replace(new File(Play.applicationPath+"/app/views").toString,"")
+ val fullPath = new File(Play.applicationPath,"/app/pages/errors/500.scaml").toString
+ fullPath.replace(new File(Play.applicationPath+"/app/pages").toString,"")
}
// --- ROUTERS
def action(action: => Any) = {

0 comments on commit c90b41f

Please sign in to comment.