From befc20e71363914c4df77ac04121ec7e28bb1d77 Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Fri, 15 Jun 2012 18:57:47 +0100 Subject: [PATCH 1/2] Index page --- modules/web.js | 4 ++-- public/styles.css | 18 ++++++++++++++++++ views/index.jade | 6 +++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/web.js b/modules/web.js index 5f0fa8a..3d9ad87 100644 --- a/modules/web.js +++ b/modules/web.js @@ -9,8 +9,8 @@ var webInterface = function(dbot) { app.set('view engine', 'jade'); app.get('/', function(req, res) { - res.redirect('/quotes'); - //res.render('index', { }); + //res.redirect('/quotes'); + res.render('index', { 'name': dbot.name }); }); // Lists the quote categories diff --git a/public/styles.css b/public/styles.css index aca5116..fa45ded 100644 --- a/public/styles.css +++ b/public/styles.css @@ -77,6 +77,24 @@ a,a:active,a:visited { text-decoration: none; } +/* Index Page */ +#modulelinks { + margin: 0; + padding: 0; +} + +.module { + display: inline-block; + width: 45%; + padding: 15px 0; + margin: 0 2%; + background: #F5F5F5; + border-radius: 15px; +} +.module:hover { + background: #BBB; +} + ul#quotelist { padding: 0; margin: 0; diff --git a/views/index.jade b/views/index.jade index 178ddc3..8372429 100644 --- a/views/index.jade +++ b/views/index.jade @@ -1,3 +1,3 @@ -div#main - p - a(href: '/quotes') Quotes +#modulelinks + a.module(href='/quotes') Quotes + a.module(href='/polls') Polls From f7851f1ddbf0708fe8cd2ae00767db3aa9ab55f3 Mon Sep 17 00:00:00 2001 From: Daniel Evans Date: Fri, 15 Jun 2012 19:04:10 +0100 Subject: [PATCH 2/2] More links --- views/polllist.jade | 2 ++ views/quotelist.jade | 2 ++ 2 files changed, 4 insertions(+) diff --git a/views/polllist.jade b/views/polllist.jade index 5f0e73b..4de9297 100644 --- a/views/polllist.jade +++ b/views/polllist.jade @@ -1,3 +1,5 @@ +div#backlink + a(href='/') « Home div#controls input(type="text", name="search", id="search-text", oninput="search(this.value)") ul#quotelist diff --git a/views/quotelist.jade b/views/quotelist.jade index 154fb1a..9643069 100644 --- a/views/quotelist.jade +++ b/views/quotelist.jade @@ -1,3 +1,5 @@ +div#backlink + a(href='/') « Home div#controls input(type="text", name="search", id="search-text", oninput="search(this.value)") ul#quotelist