{% extends "admin/base_site.html" %}
{% comment %}
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
{% endcomment %}
{% load proto_tags %}
{% load i18n %}
{% load static from staticfiles %}
{% block extrastyle %}
<style type="text/css">
  div.col1 {float:left; min-width:200px;}
  div.col2 {float:right;}
  div.menor {float:left; width:60px;}
  div.medio {float:left; width:180px;}
  div.maior {float:left; width:250px; white-space:normal; margin-right:5px;}
  ins {float:left;}
  div#theader {font-weight:bold;}
  div#blocos {overflow:hidden;}
  </style>
{% endblock %}
{% block extrahead %}
  <script type="text/javascript" src="{% static "js/jstree/_lib/jquery.js" %}"></script>
  <script type="text/javascript" src="{% static "js/jstree/jquery.jstree.js" %}"></script>
{% endblock %}
{% block breadcrumbs %}
    <div class="breadcrumbs">Você está em: 
      <a href="../../">{% trans "Home" %}</a> &rsaquo;
      <a href="{% url 'patrimonio.views.presta_contas' %}">Prestação de contas patrimonial</a>
    </div>
{% endblock %}
{% block content %}
    <h1>Prestação de contas patrimonial</h1>
    {% if termos %}
        <div id="theader">
            <div class="col1">Processo/Modalidade/Item/NF</div>
            <div class="col2">
                <div class="menor">Tipo</div>
                <div class="maior">NS</div>
                <div class="maior">Descrição</div>
                <div class="medio">Tipo equipamento</div>
                <div class="menor">Valor</div>
                <div class="menor">Agilis</div>
                <div class="menor">Checado</div>
            </div>
            <div style="clear:both;"> </div>
        </div>
        <div id="blocos"></div>
        <script type="text/javascript">
        $(function() {
            $("#blocos").jstree({
                json_data : {
                    ajax: {
        		url: function(node) {
                                 if (node == -1){
                                     return '{% url "patrimonio.views.ajax_abre_arvore" %}';
                                 }
        		         return '{% url "patrimonio.views.ajax_abre_arvore" %}?id='+node.attr("o_id")+'&model='+node.attr("o_model");
        	             },
                        type:"get",
        		success: function(ops) {
         		    data = [];
        		    for (opnum in ops) {
        			var op = ops[opnum];
        			node = {"data":op["data"], "attr":op["attr"], "state":"closed"};
        			data.push(node);
        		    }
        		    return data;
        		}
        	    }
        	},
                core : {"html_titles" : true,  "load_open" : true },
        	plugins : [ "themes", "json_data"]
            });
        });
        </script>
    {% else %}
        <table border="0" repeat="1" cellpadding="5">
            <tr><td>Não foram encontrados dados para a exibição.</td></tr>
        </table>
    {% endif %}
{% endblock %}
