Refactor preview display pages.

This commit is contained in:
Aldo Cortesi 2012-07-29 16:33:45 +12:00
parent bc84cc99cd
commit 08b95f6aa1
5 changed files with 95 additions and 38 deletions

View File

@ -1,4 +1,5 @@
.fronttable { .fronttable {
} }
@ -31,3 +32,9 @@ section {
background: #000; background: #000;
color: #fff; color: #fff;
} }
.innerlink {
text-decoration: none;
border-bottom:1px dotted;
margin-bottom: 15px;
}

View File

@ -1,26 +1,52 @@
{% extends "frame.html" %} {% extends "frame.html" %}
{% block body %} {% block body %}
<h1>Preview</h1> <div class="page-header">
<h1>pathoc preview</h1>
</div>
<div style="margin-bottom: 20px" class="row">
<div class="span2">
<h3>Specification:</h3>
</div>
<div class="span10">
{% include "request_previewform.html" %}
</div>
</div>
{% if syntaxerror %} {% if syntaxerror %}
<h2> Error: {{ syntaxerror }} </h2> <div class="row">
<pre>{{ marked }}</pre> <div class="span2">
<h3>Error:</h3>
</div>
<div class="span10">
<p style="color: #ff0000">{{ syntaxerror }}</p>
<pre>{{ marked }}</pre>
</div>
</div>
{% elif error %} {% elif error %}
<p style="color: #ff0000">{{ error }}</p> <div class="row">
<div class="span2">
<h3>Error:</h3>
</div>
<div class="span10">
<p style="color: #ff0000">{{ error }}</p>
</div>
</div>
{% else %} {% else %}
<h2>Spec:</h2> <div class="row">
<div class="span2">
<pre>{{ spec }}</pre> <h3>Request:</h3>
</div>
<h2>Request:</h2> <div class="span10">
<pre>{{ output }}</pre>
<pre>{{ output }}</pre> {% if pauses %}
<p>Note: pauses are skipped when generating previews!</p>
{% if pauses %} {% endif %}
<p>Note: pauses are skipped when generating previews!</p> </div>
{% endif %} </div>
{% endif %} {% endif %}
{% include "request_previewform.html" %}
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
<form class="form-inline" method="GET" action="/request_preview"> <form style="margin-bottom: 0" class="form-inline" method="GET" action="/request_preview">
<input <input
style="width: 20em" style="width: 20em"
id="spec" id="spec"
@ -10,7 +10,7 @@
<input type="submit" class="btn" value="preview"> <input type="submit" class="btn" value="preview">
</form> </form>
<a data-toggle="collapse" data-target="#requestexamples">Examples...</a> <a class="innerlink" data-toggle="collapse" data-target="#requestexamples">examples</a>
<div id="requestexamples" class="collapse"> <div id="requestexamples" class="collapse">
<p>Check out the <a href="/docs/language">complete language docs</a>. Here <p>Check out the <a href="/docs/language">complete language docs</a>. Here

View File

@ -1,26 +1,50 @@
{% extends "frame.html" %} {% extends "frame.html" %}
{% block body %} {% block body %}
<h1>Preview</h1> <div class="page-header">
<h1>pathod preview</h1>
</div>
<div style="margin-bottom: 20px" class="row">
<div class="span2">
<h3>Specification:</h3>
</div>
<div class="span10">
{% include "response_previewform.html" %}
</div>
</div>
{% if syntaxerror %} {% if syntaxerror %}
<h2> Error: {{ syntaxerror }} </h2> <div class="row">
<pre>{{ marked }}</pre> <div class="span2">
<h3>Error:</h3>
</div>
<div class="span10">
<p style="color: #ff0000">{{ syntaxerror }}</p>
<pre>{{ marked }}</pre>
</div>
</div>
{% elif error %} {% elif error %}
<p style="color: #ff0000">{{ error }}</p> <div class="row">
<div class="span2">
<h3>Error:</h3>
</div>
<div class="span10">
<p style="color: #ff0000">{{ error }}</p>
</div>
</div>
{% else %} {% else %}
<h2>Spec:</h2> <div class="row">
<div class="span2">
<pre>{{ spec }}</pre> <h3>Response:</h3>
</div>
<h2>Response:</h2> <div class="span10">
<pre>{{ output }}</pre>
<pre>{{ output }}</pre> {% if pauses %}
<p>Note: pauses are skipped when generating previews!</p>
{% if pauses %} {% endif %}
<p>Note: pauses are skipped when generating previews!</p> </div>
{% endif %} </div>
{% endif %} {% endif %}
{% include "response_previewform.html" %}
{% endblock %} {% endblock %}

View File

@ -1,4 +1,4 @@
<form class="form-inline" method="GET" action="/response_preview"> <form style="margin-bottom: 0" class="form-inline" method="GET" action="/response_preview">
<input <input
style="width: 20em" style="width: 20em"
id="spec" id="spec"
@ -13,7 +13,7 @@
{% endif %} {% endif %}
</form> </form>
<a data-toggle="collapse" data-target="#responseexamples">Examples...</a> <a class="innerlink" data-toggle="collapse" data-target="#responseexamples">examples</a>
<div id="responseexamples" class="collapse"> <div id="responseexamples" class="collapse">
<p>Check out the <a href="/docs/language">complete language docs</a>. Here <p>Check out the <a href="/docs/language">complete language docs</a>. Here