{% load static %}

<script type="text/javascript" src="{% static  'js/jquery.js' %}"></script>
<script type="text/javascript" src="{% static  'js/annotations.js' %}"></script>

{%  if narrow_doc == "n" %}
    <link rel="stylesheet" href="{% static 'css/document_page_narrow.css' %}">
{% else %}
    <link rel="stylesheet" href="{% static 'css/document_page.css' %}">
{% endif %}

<link type="text/css" href="{{ STATIC_URL }}css/tipsy.css" rel="stylesheet" />
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.tipsy.js"></script>

<script>
var htmlText = "{{document.text|linebreaks }}";
</script>

<div id="ListLayer">
    <a id="backlinkA" href={{back_url}}> << Back to document list </a>
    <h3 id="h3Tree">Annotation tree</h3>
    <ul>
        <ul>
        {% for annotation_name, annotation_el in annotations.iteritems %}
                <li> <table>
                    <tr>
                        <td name="annotation" style='padding-right:10px' >
                            <input type="checkbox"  name="annotationTypeList" class ="{{ annotation_name}}" elements="{{ annotation_el.0 }}"/>
                               {{ annotation_name}}
                        </td>
                        <td bgcolor="{{annotation_el.1}}" style="border:solid black 1px">&nbsp; &nbsp; &nbsp; </td>
                    </tr>
                </table></li>
        {% endfor  %}
        </ul>
    </ul>
    <div id="DocumentFeaturesLayer">

    <h3>Features</h3>
    {% for name, value in document.features.iteritems  %}

        <b>{{name}}</b> = {{ value }} <br/>

    {% endfor %}
    </div>
</div>

<div id="TextLayer">

    <div id="DocumentTitle">{{ document.name }}</div>
    <div id="DocumentText"></div>

</div>