Permalink
Browse files

Completed port of PHP code to grails.

  • Loading branch information...
1 parent a4e387b commit 305d9d3ab0a3c26aa3ce59db3154bb346daeac7d @sjhorn committed Apr 28, 2011
Showing with 3,986 additions and 467 deletions.
  1. +20 −0 .classpath
  2. +32 −0 .project
  3. +3 −0 .settings/org.codehaus.groovy.eclipse.preferences.prefs
  4. +4 −0 .settings/org.eclipse.wst.common.project.facet.core.xml
  5. +1 −1 LICENSE
  6. +3 −1 README.markdown
  7. +9 −0 application.properties
  8. +7 −0 grails-app/conf/BootStrap.groovy
  9. +32 −0 grails-app/conf/BuildConfig.groovy
  10. +91 −0 grails-app/conf/Config.groovy
  11. +32 −0 grails-app/conf/DataSource.groovy
  12. +13 −0 grails-app/conf/UrlMappings.groovy
  13. +3 −0 grails-app/conf/datastore-indexes.xml
  14. +16 −0 grails-app/conf/persistence.xml
  15. +3 −0 grails-app/conf/spring/resources.groovy
  16. +25 −0 grails-app/controllers/statuspanic/ArrowController.groovy
  17. +40 −0 grails-app/controllers/statuspanic/BargraphController.groovy
  18. +16 −0 grails-app/controllers/statuspanic/BubblelistController.groovy
  19. +17 −0 grails-app/controllers/statuspanic/ClockController.groovy
  20. +20 −0 grails-app/controllers/statuspanic/CountdownController.groovy
  21. +18 −0 grails-app/controllers/statuspanic/GridController.groovy
  22. +52 −0 grails-app/controllers/statuspanic/HomeController.groovy
  23. +8 −0 grails-app/controllers/statuspanic/MetaController.groovy
  24. +8 −0 grails-app/controllers/statuspanic/SpaceController.groovy
  25. +13 −0 grails-app/controllers/statuspanic/WeatherController.groovy
  26. +55 −0 grails-app/i18n/messages.properties
  27. +56 −0 grails-app/i18n/messages_da.properties
  28. +55 −0 grails-app/i18n/messages_de.properties
  29. +30 −0 grails-app/i18n/messages_es.properties
  30. +19 −0 grails-app/i18n/messages_fr.properties
  31. +19 −0 grails-app/i18n/messages_it.properties
  32. +19 −0 grails-app/i18n/messages_ja.properties
  33. +55 −0 grails-app/i18n/messages_nl.properties
  34. +34 −0 grails-app/i18n/messages_pt_BR.properties
  35. +34 −0 grails-app/i18n/messages_pt_PT.properties
  36. +31 −0 grails-app/i18n/messages_ru.properties
  37. +35 −0 grails-app/i18n/messages_th.properties
  38. +18 −0 grails-app/i18n/messages_zh_CN.properties
  39. +4 −0 grails-app/views/arrow/module.gsp
  40. +16 −0 grails-app/views/bargraph/module.gsp
  41. +11 −0 grails-app/views/bubblelist/module.gsp
  42. +3 −0 grails-app/views/clock/module.gsp
  43. +3 −0 grails-app/views/countdown/module.gsp
  44. +54 −0 grails-app/views/error.gsp
  45. +20 −0 grails-app/views/grid/module.gsp
  46. +22 −0 grails-app/views/home/index.gsp
  47. +3 −0 grails-app/views/meta/module.gsp
  48. 0 modules/space.module.php → grails-app/views/space/module.gsp
  49. +6 −0 grails-app/views/weather/module.gsp
  50. +0 −68 index.php
  51. +0 −30 modules/arrow.module.php
  52. +0 −67 modules/bargraph.module.php
  53. +0 −28 modules/bubblelist.module.php
  54. +0 −20 modules/clock.module.php
  55. +0 −30 modules/countdown.module.php
  56. +0 −43 modules/grid.module.php
  57. +0 −4 modules/meta.module.php
  58. +0 −168 modules/weather.module.php
  59. +16 −0 src/templates/artifacts/DomainClass.groovy
  60. +105 −0 src/templates/scaffolding/Controller.groovy
  61. +64 −0 src/templates/scaffolding/create.gsp
  62. +66 −0 src/templates/scaffolding/edit.gsp
  63. +62 −0 src/templates/scaffolding/list.gsp
  64. +66 −0 src/templates/scaffolding/show.gsp
  65. +92 −0 src/templates/war/web.xml
  66. +17 −0 test/unit/statuspanic/ArrowControllerTests.groovy
  67. +17 −0 test/unit/statuspanic/BargraphControllerTests.groovy
  68. +17 −0 test/unit/statuspanic/BubblelistControllerTests.groovy
  69. +17 −0 test/unit/statuspanic/ClockControllerTests.groovy
  70. +17 −0 test/unit/statuspanic/CountdownControllerTests.groovy
  71. +17 −0 test/unit/statuspanic/GridControllerTests.groovy
  72. +17 −0 test/unit/statuspanic/HomeControllerTests.groovy
  73. +17 −0 test/unit/statuspanic/MetaControllerTests.groovy
  74. +17 −0 test/unit/statuspanic/SpaceControllerTests.groovy
  75. +17 −0 test/unit/statuspanic/WeatherControllerTests.groovy
  76. +12 −0 web-app/WEB-INF/appengine-web.xml
  77. +42 −0 web-app/WEB-INF/applicationContext.xml
  78. +20 −0 web-app/WEB-INF/grails.xml
  79. BIN web-app/WEB-INF/lib/aopalliance-1.0.jar
  80. BIN web-app/WEB-INF/lib/appengine-api-1.0-sdk-1.4.3.jar
  81. BIN web-app/WEB-INF/lib/appengine-api-labs-1.4.3.jar
  82. BIN web-app/WEB-INF/lib/appengine-jsr107cache-1.4.3.jar
  83. BIN web-app/WEB-INF/lib/appengine-tools-api.jar
  84. BIN web-app/WEB-INF/lib/aspectjrt-1.6.8.jar
  85. BIN web-app/WEB-INF/lib/aspectjweaver-1.6.8.jar
  86. BIN web-app/WEB-INF/lib/cglib-nodep-2.1_3.jar
  87. BIN web-app/WEB-INF/lib/commons-beanutils-1.8.0.jar
  88. BIN web-app/WEB-INF/lib/commons-codec-1.4.jar
  89. BIN web-app/WEB-INF/lib/commons-collections-3.2.1.jar
  90. BIN web-app/WEB-INF/lib/commons-dbcp-1.3.jar
  91. BIN web-app/WEB-INF/lib/commons-el-1.0.jar
  92. BIN web-app/WEB-INF/lib/commons-fileupload-1.2.1.jar
  93. BIN web-app/WEB-INF/lib/commons-io-1.4.jar
  94. BIN web-app/WEB-INF/lib/commons-lang-2.4.jar
  95. BIN web-app/WEB-INF/lib/commons-pool-1.5.5.jar
  96. BIN web-app/WEB-INF/lib/commons-validator-1.3.1.jar
  97. BIN web-app/WEB-INF/lib/concurrentlinkedhashmap-lru-1.0_jdk5.jar
  98. BIN web-app/WEB-INF/lib/datanucleus-appengine-1.0.8.final.jar
  99. BIN web-app/WEB-INF/lib/datanucleus-core-1.1.5.jar
  100. BIN web-app/WEB-INF/lib/datanucleus-jpa-1.1.5.jar
  101. BIN web-app/WEB-INF/lib/ehcache-core-1.7.1.jar
  102. BIN web-app/WEB-INF/lib/ejb3-persistence-1.0.2.GA.jar
  103. BIN web-app/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar
  104. BIN web-app/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar
  105. BIN web-app/WEB-INF/lib/grails-bootstrap-1.3.7.jar
  106. BIN web-app/WEB-INF/lib/grails-core-1.3.7.jar
  107. BIN web-app/WEB-INF/lib/grails-crud-1.3.7.jar
  108. BIN web-app/WEB-INF/lib/grails-docs-1.3.7.jar
  109. BIN web-app/WEB-INF/lib/grails-gorm-1.3.7.jar
  110. BIN web-app/WEB-INF/lib/grails-resources-1.3.7.jar
  111. BIN web-app/WEB-INF/lib/grails-spring-1.3.7.jar
  112. BIN web-app/WEB-INF/lib/grails-web-1.3.7.jar
  113. BIN web-app/WEB-INF/lib/groovy-all-1.7.8.jar
  114. BIN web-app/WEB-INF/lib/hsqldb-1.8.0.10.jar
  115. BIN web-app/WEB-INF/lib/jcl-over-slf4j-1.5.8.jar
  116. BIN web-app/WEB-INF/lib/jdo2-api-2.3-eb.jar
  117. BIN web-app/WEB-INF/lib/jsr107cache-1.1.jar
  118. BIN web-app/WEB-INF/lib/jstl-1.1.2.jar
  119. BIN web-app/WEB-INF/lib/jta-1.1.jar
  120. BIN web-app/WEB-INF/lib/jul-to-slf4j-1.5.8.jar
  121. BIN web-app/WEB-INF/lib/log4j-1.2.16.jar
  122. BIN web-app/WEB-INF/lib/org.springframework.aop-3.0.5.RELEASE.jar
  123. BIN web-app/WEB-INF/lib/org.springframework.asm-3.0.5.RELEASE.jar
  124. BIN web-app/WEB-INF/lib/org.springframework.aspects-3.0.5.RELEASE.jar
  125. BIN web-app/WEB-INF/lib/org.springframework.beans-3.0.5.RELEASE.jar
  126. BIN web-app/WEB-INF/lib/org.springframework.context-3.0.5.RELEASE.jar
  127. BIN web-app/WEB-INF/lib/org.springframework.context.support-3.0.5.RELEASE.jar
  128. BIN web-app/WEB-INF/lib/org.springframework.core-3.0.5.RELEASE.jar
  129. BIN web-app/WEB-INF/lib/org.springframework.expression-3.0.5.RELEASE.jar
  130. BIN web-app/WEB-INF/lib/org.springframework.instrument-3.0.5.RELEASE.jar
  131. BIN web-app/WEB-INF/lib/org.springframework.jdbc-3.0.5.RELEASE.jar
  132. BIN web-app/WEB-INF/lib/org.springframework.jms-3.0.5.RELEASE.jar
  133. BIN web-app/WEB-INF/lib/org.springframework.orm-3.0.5.RELEASE.jar
  134. BIN web-app/WEB-INF/lib/org.springframework.oxm-3.0.5.RELEASE.jar
  135. BIN web-app/WEB-INF/lib/org.springframework.transaction-3.0.5.RELEASE.jar
  136. BIN web-app/WEB-INF/lib/org.springframework.web-3.0.5.RELEASE.jar
  137. BIN web-app/WEB-INF/lib/org.springframework.web.servlet-3.0.5.RELEASE.jar
  138. BIN web-app/WEB-INF/lib/oro-2.0.8.jar
  139. BIN web-app/WEB-INF/lib/sitemesh-2.4.jar
  140. BIN web-app/WEB-INF/lib/slf4j-api-1.5.8.jar
  141. BIN web-app/WEB-INF/lib/slf4j-log4j12-1.5.8.jar
  142. BIN web-app/WEB-INF/lib/standard-1.1.2.jar
  143. BIN web-app/WEB-INF/lib/xpp3_min-1.1.3.4.O.jar
  144. 0 web-app/WEB-INF/plugins/app-engine-0.8.10/grails-app/i18n/messages.properties
  145. +17 −0 web-app/WEB-INF/plugins/app-engine-0.8.10/plugin.xml
  146. 0 web-app/WEB-INF/plugins/gorm-jpa-0.7.1/grails-app/i18n/messages.properties
  147. +42 −0 web-app/WEB-INF/plugins/gorm-jpa-0.7.1/plugin.xml
  148. +14 −0 web-app/WEB-INF/sitemesh.xml
  149. +563 −0 web-app/WEB-INF/tld/c.tld
  150. +671 −0 web-app/WEB-INF/tld/fmt.tld
  151. +550 −0 web-app/WEB-INF/tld/grails.tld
  152. +311 −0 web-app/WEB-INF/tld/spring.tld
  153. +4 −0 web-app/WEB-INF/web.xml
  154. +6 −6 { → web-app}/config.json
  155. BIN {resources → web-app/css}/TheFreakyFace.otf
  156. BIN {resources → web-app/css}/cutouts.ttf
  157. 0 {resources → web-app/css}/cutouts.txt
  158. BIN {resources → web-app/css}/cutouts2.ttf
  159. 0 {resources → web-app/css}/cutouts2.txt
  160. +4 −0 {resources → web-app/css}/panic.css
  161. +1 −1 {resources → web-app/js}/board.js
  162. 0 {resources → web-app/js}/jquery.js
View
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="src" path="src/groovy"/>
+ <classpathentry kind="src" path="grails-app/conf"/>
+ <classpathentry kind="src" path="grails-app/controllers"/>
+ <classpathentry kind="src" path="grails-app/domain"/>
+ <classpathentry kind="src" path="grails-app/services"/>
+ <classpathentry kind="src" path="grails-app/taglib"/>
+ <classpathentry kind="src" path="test/integration"/>
+ <classpathentry kind="src" path="test/unit"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
+ <classpathentry kind="src" path=".link_to_grails_plugins/tomcat-1.3.7/src/groovy">
+ <attributes>
+ <attribute name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="web-app/WEB-INF/classes"/>
+</classpath>
View
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>statuspanic</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.springsource.sts.grails.core.nature</nature>
+ <nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>.link_to_grails_plugins</name>
+ <type>2</type>
+ <locationURI>GRAILS_ROOT/1.3.7/projects/statuspanic/plugins</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
@@ -0,0 +1,3 @@
+#Created by grails
+eclipse.preferences.version=1
+groovy.dont.generate.class.files=true
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="grails.app" version="1.0"/>
+</faceted-project>
View
@@ -1,4 +1,4 @@
- Copyright (c) 2010 Allyn Bauer
+ Copyright (c) 2011 Scott Horn
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
View
@@ -1,6 +1,8 @@
What is StatusPanic?
====================
-StatusPanic is a simple Grails application for creating a way to make a [Panic](http://panic.com)-style [Status Board](http://www.panic.com/blog/2010/03/the-panic-status-board/) with as little effort as possible.
+StatusPanic is a simple Grails application for creating a way to make a
+[Panic](http://panic.com)-style [Status Board](http://www.panic.com/blog/2010/03/the-panic-status-board/)
+with as little effort as possible.
Configuration
====================
@@ -0,0 +1,9 @@
+#Grails Metadata file
+#Wed Apr 27 16:55:43 EST 2011
+app.grails.version=1.3.7
+app.name=statuspanic
+app.servlet.version=2.4
+app.version=1
+appengine.persistence=jpa
+plugins.app-engine=0.8.10
+plugins.gorm-jpa=0.7.1
@@ -0,0 +1,7 @@
+class BootStrap {
+
+ def init = { servletContext ->
+ }
+ def destroy = {
+ }
+}
@@ -0,0 +1,32 @@
+google.appengine.sdk = "/Users/scott/appengine-java-sdk-1.4.3"
+grails.project.class.dir = "target/classes"
+grails.project.test.class.dir = "target/test-classes"
+grails.project.test.reports.dir = "target/test-reports"
+//grails.project.war.file = "target/${appName}-${appVersion}.war"
+grails.project.dependency.resolution = {
+ // inherit Grails' default dependencies
+ inherits("global") {
+ // uncomment to disable ehcache
+ // excludes 'ehcache'
+ }
+ log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
+ repositories {
+ grailsPlugins()
+ grailsHome()
+ grailsCentral()
+
+ // uncomment the below to enable remote dependency resolution
+ // from public Maven repositories
+ //mavenLocal()
+ //mavenCentral()
+ //mavenRepo "http://snapshots.repository.codehaus.org"
+ //mavenRepo "http://repository.codehaus.org"
+ //mavenRepo "http://download.java.net/maven/2/"
+ //mavenRepo "http://repository.jboss.com/maven2/"
+ }
+ dependencies {
+ // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
+
+ // runtime 'mysql:mysql-connector-java:5.1.13'
+ }
+}
@@ -0,0 +1,91 @@
+// locations to search for config files that get merged into the main config
+// config files can either be Java properties files or ConfigSlurper scripts
+
+// grails.config.locations = [ "classpath:${appName}-config.properties",
+// "classpath:${appName}-config.groovy",
+// "file:${userHome}/.grails/${appName}-config.properties",
+// "file:${userHome}/.grails/${appName}-config.groovy"]
+
+// if(System.properties["${appName}.config.location"]) {
+// grails.config.locations << "file:" + System.properties["${appName}.config.location"]
+// }
+google.appengine.application="grailsdev1"
+grails.app.context = "/"
+grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
+grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
+grails.mime.use.accept.header = false
+grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
+ xml: ['text/xml', 'application/xml'],
+ text: 'text/plain',
+ js: 'text/javascript',
+ rss: 'application/rss+xml',
+ atom: 'application/atom+xml',
+ css: 'text/css',
+ csv: 'text/csv',
+ all: '*/*',
+ json: ['application/json','text/json'],
+ form: 'application/x-www-form-urlencoded',
+ multipartForm: 'multipart/form-data'
+ ]
+
+// URL Mapping Cache Max Size, defaults to 5000
+//grails.urlmapping.cache.maxsize = 1000
+
+// The default codec used to encode data with ${}
+grails.views.default.codec = "none" // none, html, base64
+grails.views.gsp.encoding = "UTF-8"
+grails.converters.encoding = "UTF-8"
+// enable Sitemesh preprocessing of GSP pages
+grails.views.gsp.sitemesh.preprocess = true
+// scaffolding templates configuration
+grails.scaffolding.templates.domainSuffix = 'Instance'
+
+// Set to false to use the new Grails 1.2 JSONBuilder in the render method
+grails.json.legacy.builder = false
+// enabled native2ascii conversion of i18n properties files
+grails.enable.native2ascii = true
+// whether to install the java.util.logging bridge for sl4j. Disable for AppEngine!
+grails.logging.jul.usebridge = true
+// packages to include in Spring bean scanning
+grails.spring.bean.packages = []
+
+// request parameters to mask when logging exceptions
+grails.exceptionresolver.params.exclude = ['password']
+
+// set per-environment serverURL stem for creating absolute links
+environments {
+ production {
+ grails.serverURL = "http://www.changeme.com"
+ }
+ development {
+ grails.serverURL = "http://localhost:8080/${appName}"
+ }
+ test {
+ grails.serverURL = "http://localhost:8080/${appName}"
+ }
+
+}
+
+// log4j configuration
+log4j = {
+ // Example of changing the log pattern for the default console
+ // appender:
+ //
+ //appenders {
+ // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
+ //}
+
+ error 'org.codehaus.groovy.grails.web.servlet', // controllers
+ 'org.codehaus.groovy.grails.web.pages', // GSP
+ 'org.codehaus.groovy.grails.web.sitemesh', // layouts
+ 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
+ 'org.codehaus.groovy.grails.web.mapping', // URL mapping
+ 'org.codehaus.groovy.grails.commons', // core / classloading
+ 'org.codehaus.groovy.grails.plugins', // plugins
+ 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
+ 'org.springframework',
+ 'org.hibernate',
+ 'net.sf.ehcache.hibernate'
+
+ warn 'org.mortbay.log'
+}
@@ -0,0 +1,32 @@
+dataSource {
+ pooled = true
+ driverClassName = "org.hsqldb.jdbcDriver"
+ username = "sa"
+ password = ""
+}
+hibernate {
+ cache.use_second_level_cache = true
+ cache.use_query_cache = true
+ cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
+}
+// environment specific settings
+environments {
+ development {
+ dataSource {
+ dbCreate = "create-drop" // one of 'create', 'create-drop','update'
+ url = "jdbc:hsqldb:mem:devDB"
+ }
+ }
+ test {
+ dataSource {
+ dbCreate = "update"
+ url = "jdbc:hsqldb:mem:testDb"
+ }
+ }
+ production {
+ dataSource {
+ dbCreate = "update"
+ url = "jdbc:hsqldb:file:prodDb;shutdown=true"
+ }
+ }
+}
@@ -0,0 +1,13 @@
+class UrlMappings {
+
+ static mappings = {
+
+ "/$controller/$action?/$id?"{
+ constraints {
+ // apply constraints here
+ }
+ }
+ "/"(controller:"home", action:"index")
+ "500"(view:'/error')
+ }
+}
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<datastore-indexes autoGenerate="true">
+</datastore-indexes>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
+
+ <persistence-unit name="transactions-optional">
+ <provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</provider>
+ <properties>
+ <property name="datanucleus.NontransactionalRead" value="true"/>
+ <property name="datanucleus.NontransactionalWrite" value="true"/>
+ <property name="datanucleus.ConnectionURL" value="appengine"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
@@ -0,0 +1,3 @@
+// Place your Spring DSL code here
+beans = {
+}
@@ -0,0 +1,25 @@
+package statuspanic
+
+class ArrowController {
+
+ def module = {
+ def random = new Random()
+ def num = (params.value as BigDecimal)
+ if( num == null) {
+ num = (random.nextInt(198) - 100)
+ }
+ def model = [
+ num : num,
+ className : "zero-block",
+ code: "K"
+ ]
+ if(num > 0) {
+ model.className = "uparrow"
+ model.code = "A"
+ } else if( num < 0 ) {
+ model.className = "downarrow"
+ model.code = "A"
+ }
+ return model
+ }
+}
@@ -0,0 +1,40 @@
+package statuspanic
+
+class BargraphController {
+
+ def module = {
+ def max_bar_width = 300G
+ def default_padding = 12
+
+ def bars = [
+ ['GREEN', 18, 1],
+ ['PINK', 29, 3],
+ ['BLUE', 48, 3],
+ ['SERVICE DESK', 8, 2],
+ ['CI', 23, 0],
+ ['SECRETS', 15, 2]
+ ]
+ def total_outer = default_padding * 2
+ def max_width = (params.width ?: 0) as BigDecimal
+ def max_height = bars.max { it[1] }[1]
+ def num_bars = bars.size()
+ def bar_width = Math.floor(Math.min(max_bar_width, (max_width - (total_outer * num_bars)) / num_bars))
+ def final_padding = Math.max(default_padding, (max_width - ((bar_width+total_outer) * num_bars)) / num_bars / 2 ) as Integer
+
+ return [
+ bars : bars.collect { bar ->
+ def bar_height = Math.floor((bar[1] / max_height) * (params.height as Integer)) as Integer
+
+ return [
+ top_offset : (params.height as Integer) - bar_height,
+ height : bar[1],
+ remaining : bar[2],
+ bar_height : bar_height as Integer,
+ name : bar[0]
+ ]
+ },
+ bar_width : bar_width as Integer,
+ final_padding : final_padding
+ ]
+ }
+}
@@ -0,0 +1,16 @@
+package statuspanic
+
+class BubblelistController {
+
+ def module = {
+ return [
+ items : [
+ [name: '4', color: 'orange' , desc: '1:02'],
+ [name: '9', color: 'red' , desc: '9 min'],
+ [name: '14', color: 'red' , desc: '5 min'],
+ [name: '19', color: 'red' , desc: '11 min'],
+ [name: '29', color: 'orange' , desc: '3:55']
+ ]
+ ]
+ }
+}
@@ -0,0 +1,17 @@
+package statuspanic
+
+class ClockController {
+
+ def module = {
+ def time = Calendar.getInstance()
+ if(params.timezone) {
+ def tz = TimeZone.getTimeZone(params.timezone)
+ time = Calendar.getInstance( tz )
+ }
+ def format = params.format ?: "h:m a"
+
+ return [
+ time : time.format(format)
+ ]
+ }
+}
Oops, something went wrong.

0 comments on commit 305d9d3

Please sign in to comment.