From e81f24cc6e2de2ed314a1c912c4cb4853b4c13fe Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 29 Jun 2012 00:21:11 +0200 Subject: o Adding links on each item. --- Procfile | 2 +- routes/index.js | 2 +- views/data.jade | 8 +++++--- views/index.jade | 3 +-- views/layout.jade | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Procfile b/Procfile index e1d4131..8cba47f 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: node app.js +web: node app diff --git a/routes/index.js b/routes/index.js index 9bd03cb..6910dfa 100644 --- a/routes/index.js +++ b/routes/index.js @@ -23,7 +23,7 @@ exports.render = function(req, res){ clientRes.on('end', function (chunk) { var doc = collection_json.fromObject(JSON.parse(body)); res.render('data', { - title: 'Rendering ' + req.query.url, + url: req.query.url, doc: doc, headers: clientRes.headers, raw: body, diff --git a/views/data.jade b/views/data.jade index 3051d63..cb181f3 100644 --- a/views/data.jade +++ b/views/data.jade @@ -1,8 +1,8 @@ extends layout block content - h1= title - p Welcome to #{title} + h1 Collection+JSON Explorer + p Viewing #{url} form(action="/render") p @@ -24,7 +24,9 @@ block content h1 a(href="#items") Items each item, i in doc.items - h2 Item ##{i+1} + a(id="item-#{i+1}") + h2 + a(href="#item-#{i+1}") Item ##{i+1} h3 Data ul each data in item.data diff --git a/views/index.jade b/views/index.jade index 55ed3d4..af774d4 100644 --- a/views/index.jade +++ b/views/index.jade @@ -1,8 +1,7 @@ extends layout block content - h1= title - p Welcome to #{title} + h1 Collection+JSON Explorer form(action="/render") p diff --git a/views/layout.jade b/views/layout.jade index 1b7b305..8fe7f51 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -1,7 +1,7 @@ doctype 5 html head - title= title + title Collection+JSON Explorer link(rel='stylesheet', href='/stylesheets/style.css') body - block content \ No newline at end of file + block content -- cgit v1.2.3