-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
348 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package poc.resources | ||
|
||
import java.util.GregorianCalendar | ||
import java.util.Calendar | ||
import java.util.Date | ||
import java.text.SimpleDateFormat | ||
|
||
object Snippets { | ||
|
||
def generateTimetable(year: Int, month: Int, day: Int): String = { | ||
val cal = new GregorianCalendar(year, month - 1, day, 8, 30) | ||
|
||
def listDate(calendar: Calendar, idxDay: Int, idxHalfHour: Int): List[Date] = (idxDay, idxHalfHour) match { | ||
case (6, 8) => calendar.getTime::Nil | ||
case (d, 23) => | ||
val c = calendar.clone().asInstanceOf[Calendar] | ||
c.add(Calendar.MINUTE, 60 * 12 + 30) | ||
calendar.getTime::listDate(c, d + 1, 0) | ||
case (d, hh) => | ||
val c = calendar.clone().asInstanceOf[Calendar] | ||
c.add(Calendar.MINUTE, 30) | ||
calendar.getTime::listDate(c, d, hh + 1) | ||
} | ||
|
||
val df = new SimpleDateFormat("yyyyMMddHHmm") | ||
val dates = listDate(cal, 0, 0) map (d => df.format(d.getTime)) | ||
dates reduceLeft(_ + ", " + _) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
src/main/webapp/WEB-INF/poc/resources/TimetableResource.index.scaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
-@ val it: TimetableResource | ||
- import Snippets._ | ||
|
||
%html | ||
%body | ||
%h1 Timetable index | ||
|
||
#{generateTimetable(2011, 7, 18)} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
-# | ||
-# Copyright (C) 2009-2011 the original author or authors. | ||
-# See the notice.md file distributed with this work for additional | ||
-# information regarding copyright ownership. | ||
-# | ||
-# Licensed under the Apache License, Version 2.0 (the "License"); | ||
-# you may not use this file except in compliance with the License. | ||
-# You may obtain a copy of the License at | ||
-# | ||
-# http://www.apache.org/licenses/LICENSE-2.0 | ||
-# | ||
-# Unless required by applicable law or agreed to in writing, software | ||
-# distributed under the License is distributed on an "AS IS" BASIS, | ||
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-# See the License for the specific language governing permissions and | ||
-# limitations under the License. | ||
-# | ||
|
||
-@ var body: String | ||
-@ var title : String = "Scalate Sample" | ||
- response.setContentType("text/html") | ||
|
||
-# Only include the console if it's available and the engine is in dev mode. | ||
- val include_console = engine.isDevelopmentMode && engine.resourceLoader.exists("/org/fusesource/scalate/console/console_head.scaml") | ||
|
||
!!! Basic | ||
%html(lang="en") | ||
%head | ||
%meta(http-equiv="Content-Type" content="text/html; charset=utf-8") | ||
%meta(name="description" content="description goes here") | ||
%meta(name="keywords" content="keywords,goes,here") | ||
%meta(name="author" content="Your Name") | ||
|
||
- if (include_console) | ||
= include("/org/fusesource/scalate/console/console_head.scaml") | ||
|
||
%link(href={uri("/css/style.css")} rel="stylesheet" type="text/css") | ||
|
||
- if (include_console) | ||
%link(href={uri("/css/scalate/console.css")} rel="stylesheet" type="text/css") | ||
|
||
%title | ||
= title | ||
|
||
%body | ||
#navigation | ||
.wrapper | ||
%ul | ||
- if (requestUri.startsWith("/index.")) | ||
%li | ||
%span Home | ||
- else | ||
%li | ||
%a(href={uri("/")}) | ||
Home | ||
%li | ||
%a(href="http://scalate.fusesource.org/") | ||
Documentation | ||
|
||
#content | ||
.wrapper | ||
!~~ body | ||
|
||
#footer | ||
.wrapper | ||
%br | ||
- if (include_console) | ||
= include("/org/fusesource/scalate/console/console.scaml") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Copyright (C) 2009-2011 the original author or authors. | ||
* See the notice.md file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#scalate-console { | ||
position:fixed; | ||
top:40px; | ||
right:10px; | ||
background: #FDFCAD; | ||
padding:10px; | ||
border: 1px solid #BDBD81; | ||
font-family:Arial,Verdana,Helvetica,sans-serif; | ||
font-size: 80%; | ||
max-width: 400px; | ||
} | ||
|
||
#scalate-console .archetypes ul, #scalate-console .templates ul, #scalate-console .resources ul, #scalate-console .layouts ul { | ||
padding-left:20px; | ||
overflow: auto; | ||
} | ||
|
||
#scalate-console .toggle { | ||
text-align: right; | ||
} | ||
|
||
#scalate-console .toggle img { | ||
vertical-align: middle; | ||
} | ||
|
||
#scalate-console div.attributes { | ||
margin: 10px; | ||
overflow: auto; | ||
background: white; | ||
} | ||
|
||
#scalate-console div.attributes table th { | ||
text-align: left; | ||
color: #993333; | ||
} | ||
#scalate-console div.attributes table td { | ||
padding:2px; | ||
border-top: 1px solid #BDBD81; | ||
} | ||
|
||
#scalate-console div.body { | ||
margin: 10px; | ||
overflow: auto; | ||
max-height: 300px; | ||
background: white; | ||
} | ||
|
||
#scalate-console div.systemProperties { | ||
margin: 10px; | ||
overflow: auto; | ||
max-height: 300px; | ||
background: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
/** | ||
* Copyright (C) 2009-2011 the original author or authors. | ||
* See the notice.md file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
body, html { | ||
font-family:Arial,Verdana,Helvetica,sans-serif; | ||
color: #666666; | ||
} | ||
body, html, table, tr, td, tbody { | ||
padding:0; | ||
margin:0; | ||
vertical-align: top; | ||
} | ||
body { | ||
padding-top: 20px; | ||
} | ||
|
||
h1, h2, h3, h4, h5, h6 { | ||
overflow: visible; | ||
color: #993333; | ||
} | ||
|
||
/* | ||
h1 { | ||
margin-top: 0em; | ||
margin-bottom: 2em; | ||
} | ||
*/ | ||
|
||
p { margin-bottom:0px; } | ||
|
||
a { | ||
color: #990000; | ||
font-weight:bold; | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
color: #ff3333; | ||
text-decoration: underline; | ||
} | ||
|
||
img { | ||
border: none; | ||
/* | ||
padding-right:2em | ||
*/ | ||
} | ||
|
||
.wrapper { min-width: 762px; width: 762px; margin: 0 auto; } | ||
|
||
#navigation { width: 100%; float: left; | ||
font-family: Helvetica,Verdana,Arial,sans-serif; | ||
background: black; | ||
text-align:center; padding: 8px; | ||
color: #b55; | ||
font-size: 10pt; | ||
font-weight: bold; | ||
position: absolute; | ||
top: 0px; | ||
} | ||
#navigation a { color: white; } | ||
#navigation ul { display: block; margin:0; padding:0; } | ||
#navigation li { list-style-type: none; display: inline; margin:0 5px 0 5px;} | ||
|
||
#overview { width: 100%; padding-top:20px} | ||
#overview div.message { | ||
font-size: 11pt; | ||
margin-top: -20px; | ||
padding-left: 120px; | ||
width: 350px; | ||
} | ||
#overview div.message h1{ margin-bottom: 5px; display:none; } | ||
#overview div.message p{ margin-top: 0px; padding-bottom:14px; } | ||
|
||
#content { width: 100%; float: left; } | ||
#content .wrapper { min-width: 700px; width: 700px; margin: 0 auto; padding-top: 1em} | ||
#content div.left { | ||
float:left; | ||
width:200px; | ||
text-align:right; | ||
font-size: 18pt; | ||
clear:both; | ||
} | ||
#content h1 { | ||
font-size: 18pt; | ||
} | ||
#content div.right { | ||
float:right; | ||
width:450px; | ||
text-align:left; | ||
} | ||
|
||
#blog { width: 100%; float: left; } | ||
#blog .wrapper { min-width: 600px; width: 600px; margin: 0 auto; } | ||
#blog h1 { | ||
font-family: HelveticaNeue,"Helvetica Neue",Helvetica,Arial,Verdana,sans-serif; | ||
font-size: 18pt; color: #993333; | ||
} | ||
#blog h2 { | ||
border-bottom: thin dashed #DDD; | ||
font-size: 16pt; | ||
margin-bottom: 5px; | ||
} | ||
#blog div.post p { | ||
padding-left: 10px; | ||
} | ||
#blog div.post .details { | ||
padding-top: 5px; | ||
color: #ccc; | ||
font-size: 10pt; | ||
font-family: HelveticaNeue,"Helvetica Neue",Helvetica,Arial,Verdana,sans-serif; | ||
} | ||
|
||
#content .post h2 { | ||
margin-bottom:5px; | ||
} | ||
#content .post .details { | ||
color: #ccc; | ||
font-size: 10pt; | ||
font-family: HelveticaNeue,"Helvetica Neue",Helvetica,Arial,Verdana,sans-serif; | ||
margin-top:0px; | ||
} | ||
|
Oops, something went wrong.