From 7f98cac326c59c4196f2aba8263af5a72172b7f7 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Sat, 12 Mar 2011 12:36:30 -0500 Subject: [PATCH] add a notice that the demo is only a demo this is for visitors who don't read the docs and just arrive at the demo site -- i want them to know that the demo is not the whole product, just an example --- client/css/style.css | 13 +++++++++++ server.js | 52 +++++++++++++++++++++++++------------------- views/index.jade | 3 +++ views/layout.jade | 2 +- 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 6586869..ea2021e 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -451,3 +451,16 @@ input:hover { } + +.notice-bar { + xbackground-color: #ccc; + opacity: .2; + padding: 0; + margin: 0; + xtext-align: center; + margin-left: 300px; +} + +.notice-bar a { + color: #333; +} diff --git a/server.js b/server.js index 016d573..d04c5b3 100644 --- a/server.js +++ b/server.js @@ -60,9 +60,16 @@ app.get('/', function(req, res) { }); }); -app.get('/:id', function(req, res){ +app.get('/demo', function(req, res) { res.render('index.jade', { - locals: {pageTitle: 'scrumblr'} + locals: {pageTitle: 'scrumblr - demo', demo: true} + }); +}); + +app.get('/:id', function(req, res){ + + res.render('index.jade', { + locals: {pageTitle: ('scrumblr - ' + req.params.id) } }); }); @@ -572,33 +579,34 @@ function setUserName ( client, name ) } +function cleanAndInitializeDemoRoom() +{ + // DUMMY DATA + redisClient.del(REDIS_PREFIX + '-room:/demo-cards', function (err, res) { + redisClient.del(REDIS_PREFIX + '-room:/demo-columns', function (err, res) { + createColumn( '/demo', 'Not Started' ); + createColumn( '/demo', 'Started' ); + createColumn( '/demo', 'Testing' ); + createColumn( '/demo', 'Review' ); + createColumn( '/demo', 'Complete' ); -// DUMMY DATA -redisClient.del(REDIS_PREFIX + '-room:/demo-cards', function (err, res) { - redisClient.del(REDIS_PREFIX + '-room:/demo-columns', function (err, res) { - createColumn( '/demo', 'Not Started' ); - createColumn( '/demo', 'Started' ); - createColumn( '/demo', 'Testing' ); - createColumn( '/demo', 'Review' ); - createColumn( '/demo', 'Complete' ); + createCard('/demo', 'card1', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); + createCard('/demo', 'card2', 'Hello this is a new story.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'white'); + createCard('/demo', 'card3', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); + createCard('/demo', 'card4', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); - - createCard('/demo', 'card1', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); - createCard('/demo', 'card2', 'Hello this is a new story.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'white'); - createCard('/demo', 'card3', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); - createCard('/demo', 'card4', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); - - createCard('/demo', 'card5', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); - createCard('/demo', 'card6', 'Hello this is a new card.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); - createCard('/demo', 'card7', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); - createCard('/demo', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); + createCard('/demo', 'card5', 'Hello this is fun', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); + createCard('/demo', 'card6', 'Hello this is a new card.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'yellow'); + createCard('/demo', 'card7', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'blue'); + createCard('/demo', 'card8', '.', roundRand(600), roundRand(300), Math.random() * 10 - 5, 'green'); + }); }); -}); +} // - +cleanAndInitializeDemoRoom(); diff --git a/views/index.jade b/views/index.jade index 079f1ea..2706ad3 100644 --- a/views/index.jade +++ b/views/index.jade @@ -1,3 +1,6 @@ +- if (locals.demo) + div.notice-bar this is a demo board. to make a private board, go to scrumblr.ca + h1 scrumblr by aliasaria div.board-outline diff --git a/views/layout.jade b/views/layout.jade index 5e17d20..4d06738 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -20,6 +20,6 @@ html(lang="en") - title scrumblr + title= locals.pageTitle body!= body