extends layout block href if typeof href != 'string' | <no href> else span a(href=href) #{href} | a(href=urlgenerator.render(href)) Explore block link - var name = typeof link.name == 'string' ? link.name : '' - var prompt = typeof link.prompt == 'string' ? link.prompt : '' - var href = link.href table tr td href td block href tr td rel td if isUrl(link.rel) a(href=link.rel) #{link.rel} else | #{link.rel} tr td name td #{name} tr td prompt td #{prompt} if link.render == 'image' tr td td: img(src=link.href, alt=link.name, title=name) block meta - var href=collection.href table tr td version td #{collection.version} tr td href td: block href form(action='http://redbot.org/?') p input(type='text', name='uri', value=url, type='hidden') input(type='text', name='req_hdr', value='Accept: application/vnd.collection+json', type='hidden') input(type='text', type='submit', value='Check with redbot.org') if collection.links.length > 0 h2 Collection Links each link, i in collection.links - var title = link.prompt || link.name - title = title ? ': ' + title : '' h3 Collection Link ##{i}#{title} block link // TODO: If the collection has prev/next links, add buttons to // automaticaly navigate those. // TODO: Add ability to show the raw part of the collection. block items if collection.items.length == 0 p Collection has no items. else // p The feed has #{collection.items.length} items. each item, i in collection.items // a(id='item-#{i+1}'): h2: a(href='#item-#{i+1}') Item ##{i+1} h2 Item ##{i+1} - var href=item.href p href: block href if item.links.length > 0 h3 Item Links each link, i in item.links h4 Item Link ##{i} block link h3 Data dl(class='dl-horizontal') each data in item.data dt #{data.name} dd #{data.value} block queries if collection.queries.length == 0 p Collection has no queries. else each query in collection.queries - var name = query.prompt || query.name || 'Unnamed query' h2= name div(class='row') div(class='span12') form(action='/render', class='well form-horizontal') input(type='hidden', name='url', value=query.href) fieldset each data in query.data - var value = params[data.name] || data.value div(class='control-group') label(class='control-label', for=data.name) #{data.name} div(class='controls') input(type='text', name='param-' + data.name, value=value, class='input-xlarge') div(class='control-group') div(class='controls') input(type='submit') Execute // button(class='execute-query') Execute block headers // a(id='headers'): h1: a(href='#headers') Headers pre table each value, key in headers tr td #{key}: td #{value} block formatted_body // a(id='formatted-body'): h1: a(href='#formatted-body') Formatted body pre= formattedBody block raw_body // a(id='body'): h1: a(href='#body') Raw body pre= rawBody block navbar div(class='navbar navbar-fixed-top') div(class='navbar-inner') div(class='container') a(class='btn btn-navbar', data-toggle='collapse', data-target='.nav-collapse') span(class='icon-bar') span(class='icon-bar') span(class='icon-bar') span(class='icon-bar') span(class='icon-bar') span(class='icon-bar') a(class='brand', href='/') Collection+JSON Explorer div(class='nav-collapse') ul(class='nav') li(class='active'): a(href='#meta') Meta li: a(href='#items') Items li: a(href='#queries') Queries li: a(href='#headers') Headers li: a(href='#formatted-body') Formatted Body li: a(href='#raw-body') Raw Body block content if typeof err != 'undefined' section(id='error') div(class='page-error') h1 Error p Error rendering #{url} p= err else section(id='meta') div(class='page-header') h1 Meta block meta section(id='items') div(class='page-header') h1 Items if collection.items.length > 1 small #{collection.items.length} items block items section(id='queries') 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 block formatted_body section(id='raw-body') div(class='page-header') h1 Raw Body block raw_body