From b710f1c071d75d4b028c61bb6f3927c2cd4aadf5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 4 Jul 2012 13:34:51 +0200 Subject: o Always showing the http response, even when the body couldn't be decoded. --- views/data.jade | 45 ++++++++++++++++++++------------------------- views/index.jade | 5 +++-- 2 files changed, 23 insertions(+), 27 deletions(-) (limited to 'views') diff --git a/views/data.jade b/views/data.jade index 9f64ddf..edaa4d6 100644 --- a/views/data.jade +++ b/views/data.jade @@ -128,13 +128,16 @@ block queries div(class='controls') input(type='submit') Execute -block headers - pre - table - each value, key in headers - tr - td #{key}: - td #{value} +block http_response + div(class='row-fluid') + pre + table + each value, key in headers + tr + td #{key}: + td #{value} + | + | #{rawBody} block navbar div(class='navbar navbar-fixed-top') @@ -164,7 +167,6 @@ block sidebar ul(class='nav nav-list') if typeof err != 'undefined' li(class='nav-header'): a(href='#error') Error - li(class='nav-header'): a(href='#raw-body') Raw Body else li(class='nav-header'): a(href='#meta') Meta each link, i in collection.links @@ -177,22 +179,19 @@ block sidebar each query, i in collection.queries li: a(href='#query-' + (i + 1)) mixin get_name(query, 'Query', i) - li(class='nav-header'): a(href='#headers') Headers li(class='nav-header'): a(href='#formatted-body') Formatted Body - li(class='nav-header'): a(href='#raw-body') Raw Body + li(class='nav-header'): a(href='#http-response') HTTP Response block inner_content if typeof err != 'undefined' section(id='error') - div(class='page-error') + div(class='page-header') h1 Error - p Error rendering #{url} + div(class='row-fluid') + p Error rendering: #{url} + a(class='btn btn-primary btn-mini', href=urlgenerator.render(url)) Retry p= err - section(id='raw-body') - div(class='page-header') - h1 Raw Body - pre= rawBody else section(id='meta') div(class='page-header') @@ -208,23 +207,19 @@ block inner_content div(class='page-header') h1 Queries block queries - section(id='headers') - div(class='page-header') - h1 Headers - block headers section(id='formatted-body') div(class='page-header') h1 Formatted Body pre= formattedBody - section(id='raw-body') - div(class='page-header') - h1 Raw Body - pre= rawBody + + section(id='http-response') + div(class='page-header') + h1 HTTP Response + block http_response block content div(class='row-fluid') div(class='span3') block sidebar div(class='span9') - - console.log('fuck') block inner_content diff --git a/views/index.jade b/views/index.jade index 913b131..f9ef5d2 100644 --- a/views/index.jade +++ b/views/index.jade @@ -64,7 +64,7 @@ block inner_content h3 The Source Code p The source code is available - a(href='trygvis.dyndns.org/~trygvis/git/2012/06/collection+json-explorer.git') here + a(href='http://trygvis.dyndns.org/~trygvis/git/2012/06/collection+json-explorer.git') here | . div(class='span4') @@ -77,7 +77,8 @@ block inner_content |explorer: a(href='http://' + host + '/render?url=http%3A%2F%2Femployee.herokuapp.com', class='label label-info') explore now! - p The specification contains a few example collections too which you can explore: + p The specification contains a few example collections too which + | you can explore: - var examples = [ "minimal", "collection", "item", "queries", "template", "error" ] each example, i in examples - var u='http://' + host + '/render?url=' + encodeURIComponent('http://' + host + '/examples/from-spec/' + example + '.collection+json') -- cgit v1.2.3