PageRenderTime 17ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 36!!! Basic
 37html(lang="en")
 38  head
 39    meta(content="text/html; charset=utf-8" http-equiv="Content-Type")
 40    meta(content="scala template engine implementing HAML, JSP, Erb style templates" name="description")
 41    meta(content="scalate,scala,template engine,haml,erb,jsp" name="keywords")
 42    meta(content="Scalate" name="author")
 43    script(src={uri("/scripts/jquery.js")})
 44    :javascript
 45      $(function() {
 46        $("#navigation div.edit img").click(function() {
 47          $("#files_popup").toggle("slow");
 48          return false;
 49        });
 50      });    
 51    -# link(type="text/css" rel="stylesheet" href={uri("/styles/bootstrap-1.2.0.min.css")})
 52    link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/pygmentize.css")})
 53    link(type="text/css" rel="stylesheet" href={uri("/styles/impact/css/site.css")})
 54
 55    - if (head!=null)
 56      !~~ head
 57
 58    -#
 59      - if (include_console)
 60        - include("/org/fusesource/scalate/console/console_head.scaml")
 61        link(href={uri("/css/scalate/console.css")} rel="stylesheet" type="text/css")
 62    
 63    title= title
 64  body
 65    
 66    #navigation
 67      .edit
 68        img(src={uri("/images/edit.png")})
 69      .wrapper
 70        - include("/_navigation.ssp.md")
 71
 72    #files_popup.popover.top
 73      .inner
 74        h3.title Fork this page on GitHub
 75        .content
 76          ul
 77            - for( file <- templates)
 78              li
 79                a(href={git_edit_page_base+"/"+file}) = file
 80            - for( file <- layouts)
 81              li
 82                a(href={git_edit_page_base+"/"+file}) = file          
 83                
 84    - if (overview!=null)
 85      div#overview
 86        div.wrapper
 87          -if ( project_logo!=null )  
 88            div.logo
 89              img(src="#{uri(project_logo)}" alt="#{project_name} logo")
 90          div.message
 91            !~~ overview
 92            
 93    - if (spot!=null)
 94      div#spot
 95        div.wrapper
 96          !~~ spot
 97
 98    - if (body!=null)
 99      div#content
100        div.wrapper
101          !~~ body
102          
103    - if (blog!=null)
104      div#blog
105        div.wrapper
106          !~~ blog
107          
108    -#
109      - if (include_console)
110        = include("/org/fusesource/scalate/console/console.scaml")
111
112    :javascript
113      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
114      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
115      </script> 
116      <script type="text/javascript"> 
117      try {
118      var pageTracker = _gat._getTracker("UA-1347593-12");
119      pageTracker._trackPageview();
120      } catch(err) {}