/scalate-website/src/WEB-INF/scalate/layouts/default.jade

http://github.com/scalate/scalate · Jade · 120 lines · 108 code · 12 blank · 0 comment · 7 complexity · b50d1e609ff3a6619e4607628963bae4 MD5 · raw file

  1. -#
  2. -# Copyright (C) 2009-2010 the original author or authors.
  3. -# See the notice.md file distributed with this work for additional
  4. -# information regarding copyright ownership.
  5. -#
  6. -# Licensed under the Apache License, Version 2.0 (the "License");
  7. -# you may not use this file except in compliance with the License.
  8. -# You may obtain a copy of the License at
  9. -#
  10. -# http://www.apache.org/licenses/LICENSE-2.0
  11. -#
  12. -# Unless required by applicable law or agreed to in writing, software
  13. -# distributed under the License is distributed on an "AS IS" BASIS,
  14. -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. -# See the License for the specific language governing permissions and
  16. -# limitations under the License.
  17. -#
  18. - response.setContentType("text/html")
  19. -@ var title : String = ""
  20. -@ var body: String = null
  21. -@ var overview: String = null
  22. -@ var spot: String = null
  23. -@ var blog: String = null
  24. -@ var head: String = null
  25. - val include_console = engine.isDevelopmentMode && engine.resourceLoader.exists("/org/fusesource/scalate/console/console_head.scaml")
  26. -
  27. def templates: List[String] = attributes.get("scalateTemplates") match {
  28. case Some(list: List[String]) => list.map(_.stripPrefix("/")).distinct.reverse
  29. case _ => Nil
  30. }
  31. def layouts: List[String] = attributes.get("scalateLayouts") match {
  32. case Some(list: List[String]) => list.map(_.stripPrefix("/")).distinct.reverse
  33. case _ => Nil
  34. }
  35. !!! Basic
  36. html(lang="en")
  37. head
  38. meta(content="text/html; charset=utf-8" http-equiv="Content-Type")
  39. meta(content="scala template engine implementing HAML, JSP, Erb style templates" name="description")
  40. meta(content="scalate,scala,template engine,haml,erb,jsp" name="keywords")
  41. meta(content="Scalate" name="author")
  42. script(src={uri("/scripts/jquery.js")})
  43. :javascript
  44. $(function() {
  45. $("#navigation div.edit img").click(function() {
  46. $("#files_popup").toggle("slow");
  47. return false;
  48. });
  49. });
  50. -# link(type="text/css" rel="stylesheet" href={uri("/styles/bootstrap-1.2.0.min.css")})
  51. link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/pygmentize.css")})
  52. link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/site.css")})
  53. - if (head!=null)
  54. !~~ head
  55. -#
  56. - if (include_console)
  57. - include("/org/fusesource/scalate/console/console_head.scaml")
  58. link(href={uri("/css/scalate/console.css")} rel="stylesheet" type="text/css")
  59. title= title
  60. body
  61. #navigation
  62. .edit
  63. img(src={uri("/images/edit.png")})
  64. .wrapper
  65. - include("/_navigation.ssp.md")
  66. #files_popup.popover.top
  67. .inner
  68. h3.title Fork this page on GitHub
  69. .content
  70. ul
  71. - for( file <- templates)
  72. li
  73. a(href={git_edit_page_base+"/"+file}) = file
  74. - for( file <- layouts)
  75. li
  76. a(href={git_edit_page_base+"/"+file}) = file
  77. - if (overview!=null)
  78. div#overview
  79. div.wrapper
  80. -if ( project_logo!=null )
  81. div.logo
  82. img(src="#{uri(project_logo)}" alt="#{project_name} logo")
  83. div.message
  84. !~~ overview
  85. - if (spot!=null)
  86. div#spot
  87. div.wrapper
  88. !~~ spot
  89. - if (body!=null)
  90. div#content
  91. div.wrapper
  92. !~~ body
  93. - if (blog!=null)
  94. div#blog
  95. div.wrapper
  96. !~~ blog
  97. -#
  98. - if (include_console)
  99. = include("/org/fusesource/scalate/console/console.scaml")
  100. :javascript
  101. var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  102. document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  103. </script>
  104. <script type="text/javascript">
  105. try {
  106. var pageTracker = _gat._getTracker("UA-1347593-12");
  107. pageTracker._trackPageview();
  108. } catch(err) {}