Skip to content

Commit

Permalink
Changed from "views" to "pages" to get around precompilation issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Raible committed Feb 8, 2012
1 parent 75889ba commit c90b41f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions conf/dependencies.yml
@@ -1,4 +1,4 @@
self: play -> scalate 0.2
self: play -> scalate 0.2.5

require:
- play
Expand All @@ -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 -> *
12 changes: 6 additions & 6 deletions src/play/modules/scalate/ScalateTemplate.scala
Expand Up @@ -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)
Expand All @@ -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 => {
Expand Down Expand Up @@ -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) = {
Expand Down

0 comments on commit c90b41f

Please sign in to comment.