checkpoint
authordsc <david.schoonover@gmail.com>
Thu, 16 Feb 2012 19:46:37 +0000 (11:46 -0800)
committerdsc <david.schoonover@gmail.com>
Thu, 16 Feb 2012 19:46:37 +0000 (11:46 -0800)
lib/server/view-helpers.co
www/css/colors.styl
www/css/forms.styl
www/css/graph.styl
www/graph.jade
www/layout.jade
www/mixins/helpers.jade [new file with mode: 0644]

index f7e7cbc..e33cfa7 100644 (file)
@@ -1,5 +1,8 @@
 # Utilities for use in templates
 
+# maybe!
+exports.require = require
+
 fs   = exports.fs   = require 'fs'
 path = exports.path = require 'path'
               
index 0069ec3..e6bd3b2 100644 (file)
@@ -11,6 +11,8 @@ $foot_text    = #505050
 $body_link    = #2d588f
 $foot_link    = #666
 
+$border_color = #ccc
+
 /* spot colors */
 $hilite_dkblue  = #182B53
 $hilite_ltblue  = #4596FF
index e69de29..fd37163 100644 (file)
@@ -0,0 +1,14 @@
+@import 'nib'
+@import 'colors'
+
+fieldset
+    position relative
+    padding 1em
+    border 1px solid $border_color
+    border-radius 5px
+    
+    *
+        position relative
+    
+    legend
+        padding 0.25em 0.5em
index e69de29..84f5d4b 100644 (file)
@@ -0,0 +1,2 @@
+@import 'nib'
+@import 'colors'
index 7993c72..0707dbc 100644 (file)
@@ -3,12 +3,19 @@ extends layout
 block title
     title Kraken: Graph Test Page
 
-append content
+append styles
+    mixin css('forms.css')
+    mixin css('graph.css')
+    //- 
+        link(type='text/css', rel='stylesheet', media='screen', href='/css/forms.css')
+        link(type='text/css', rel='stylesheet', media='screen', href='/css/graph.css')
+
+block content
     section.graph
         .viewport
-        fieldset.settings
+        fieldset
             legend Settings
-            
-            mixin text_field('data', 'data/page_views_by_project.csv')
+            form.settings
+                mixin text_field('data', 'data/page_views_by_project.csv')
     
 
index 374da14..a23055a 100644 (file)
@@ -1,3 +1,4 @@
+include mixins/helpers
 include mixins/forms
 
 !!! html
@@ -8,7 +9,7 @@ html
             
             block styles
                 link(type='text/css', rel='stylesheet', media='screen', href='/css/reset.min.css')
-                link(type='text/css', rel='stylesheet', media='screen', href="/css/layout.css?#{version}")
+                mixin css('layout.css')
             
             link(type="image/ico", rel="icon", href="/favicon.ico")
             link(type="image/x-icon", rel="shortcut icon", href="/favicon.ico")
diff --git a/www/mixins/helpers.jade b/www/mixins/helpers.jade
new file mode 100644 (file)
index 0000000..39d433b
--- /dev/null
@@ -0,0 +1,10 @@
+- if (typeof version == 'undefined' || version == null || !version || version === 'dev') { version = String(new Date().getTime()); }
+
+mixin css(href, media, root)
+    - media = media || 'screen'
+    - root = root || '/css'
+    - var ver = (version ? '?'+version : '')
+    - href = (root ? root+'/' : '') + href + ver
+    link(type='text/css', rel='stylesheet', media=media, href=href)
+
+