<%inherit file='base.mako'/>

<!-- BEGIN sidebar -->
<div id="sidebar">

<div class="box">
<div class="box_header">View Table </div><br />

<%
tc = c.tcnx.cursor()
tc.execute("\d")
%>

<form name="nav">
<select name="SelectURL" >

% for xr in tc.fetchall():
    <option value="index?query=view table ${xr[0]}" selected="selected">${xr[0].upper()}</option>
% endfor

<%
c.tcnx.commit()
%>

<input type="button" value=" View " onclick=
"document.location.href= document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value;" />
</select>
</form>
</div>

<div class="box">
<div class="box_header">Legend</div><br />
<table class="legend">
<tr><td><span class="certain-box">Blue</span></td><td>Certain</td></tr>
<tr><td><span class="question-box">Green</span></td><td>Uncertain</td></tr>
<tr><td><span class="conf-box2">Orange</span></td><td>Uncertain w/Confidences</td></tr>
<tr><td><b>Attr</b></td><td>Certain attribute</td></tr>
<tr><td><i>Attr*</i></td><td>Uncertain attribute</td></tr>
<tr><td><img src="img/down.gif" title="lineage" alt="Blue" /></td><td>Show lineage</td></tr>
<tr><td><img src="img/down-red.gif" title="external lineage" alt="Red" /></td><td>Show external lineage</td></tr>
<tr><td><div class="conf-box2">conf</div></td><td>Compute confidences</td></tr>
</table>
</div>
<div class="box">
<div class="box_header">Lineage Legend</div><br />
<table class="legend">
<tr><td>No line</td><td>&nbsp;&and; (and)</td></tr>
<tr><td><span class="and">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></td><td>&nbsp;&and; (and)</td></tr>
<tr><td><hr /><hr /></td><td>&nbsp;&or; (or)</td></tr>
<tr><td><span class="negative">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></td><td>&nbsp;&and; &not; (and not)</td></tr>
</table>
</div>

% if len(session['user'].history) > 0:
    <div class="box">
    <div class="box_header">Command History  (<a href="clearHistory">Clear</a>) </div>
    <p>
    % for command in reversed(session['user'].history):
        <div class="legend">
        <a href="javascript:void(0)" onclick="javascript:document.qbox.query.value='${command}';">
        ${command.replace("\\'", "'").replace('\\\\', '\\') | h}
        </a>
        </div>
    % endfor
    </p>
    </div>
% endif

<%include file='links.mako'/>

</div>
<!-- END sidebar -->

<!-- BEGIN content -->
<div id="content">

<%include file='query.mako'/>

% if c.results is not None:
    <%include file='result.mako'/>
% endif

</div>
<!-- END content -->
