In mytemplates/thewebapp make the new template savedquery.html
Add the following:
{% if the_username %}
Hello <b>{{ the_username }}</b>, you are logged in. Do you want to <a href="/logout/">Logout?</a><br>
{% if queries %}
<h3>Use a previously submitted Query</h3><form action="/savedqueries/"><table border="1"><th>Query</th><th>The query's details</th><th>The query submitted</th>
{% for aq in queries%}
<tr><td><input type=radio name="selectedquery" value={{aq.pk}}></td><td>
URL:<dd><b>{{aq.url}}</b></dd><br>
{%if aq.object != ''%}Object:<dd><b>{{aq.object}}</b></dd><br>{%endif%}
Type of Query:<dd><b>{{aq.thekind}}</b></dd><br>
{% if aq.filename != ''%}Input File:<dd><b>{{aq.filename}}</b></dd><br>{%endif%}
{% if aq.dattr != '' %}Attribute selected:<dd><b>{{aq.dattr}}</b></dd><br>{%endif%}
{% if aq.sattr != '' %}Attributes selected:<dd><b>{{aq.sattr}}</b></dd><br>{%endif%}
{% if aq.aattrvalue != '' %}
roleName:<dd><b>{{aq.rolename}}</b></dd><br>
{%if aq.cql2%}endName:{%else%}className:{%endif%}<dd><b>{{aq.classname}}</b></dd><br>
Attribute selected:<dd><b>{{aq.aattr}}</dd></b><br>
Predicate selected:<dd><b>{{aq.predicate}}</dd></b><br>
Value selected:<dd><b>{{aq.aattrvalue}}</dd></b><br>
{%endif%}
<br></td><td>
{%if aq.cql2%}CQL2 Query<br>
{%else%}CQL1 Query<br>
{%endif%}
<textarea rows="10" cols="75">{{aq.query}}</textarea></td></tr>
{%endfor%}
</table><input type="submit" value="Submit" /></form>
{%else%}
<p><h2>You haven't queried any data services yet</h2></p>
{%endif%}
{% if stringw %}
<h3>Results</h3><textarea rows="50" cols="150">{{stringw}}</textarea><br>
{%endif%}
{% else %}
Hello, do you want to <a href="/login/">Login</a> to save queries and query secure data services?<br><p><h2>You have to login to save queries and access your stored queries</h2></p>
{% endif %}
<a href="/index/">Back to the Index</a><br>