Document model appears to fetch mostly properly

Can fetch Documents, and then get pages triggers page retrieval and
related field retrieval.
This commit is contained in:
Mark Riedesel 2013-11-14 00:54:32 -06:00
parent 806f22db17
commit 9d2d000e48
5 changed files with 159 additions and 9 deletions

View file

@ -0,0 +1,8 @@
{% extends 'admin/change_form.html' %}
{% load i18n admin_static admin_modify %}
{% load admin_urls %}
{% block object-tools-items %}
<li><a href="{% url 'admin:preview' original.pk|admin_urlquote %}">Preview</a></li>
{{ block.super }}
{% endblock %}

View file

@ -0,0 +1,57 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_modify %}
{% load admin_urls %}
{% block extrahead %}{{ block.super }}
{{ media }}
{% endblock %}
{% block content %}
<style type="text/css">
.clearfix:after { content: " "; display: block; height: 0; clear:both, visiblity: hidden; }
.clearfix { display: inline-block; _height: 1%; clear: both; }
.clearfix { display: block; clear: both; }
#pff { max-width: 100%; }
.pff-field {
text-indent: -9999px;
white-space: nowrap;
}
.pff-field:hover {
}
.pff-field-t {
background: rgba(0,255,0,0.2);
}
.pff-field-b {
background: rgba(0,0,255,0.2);
}
</style>
<script type="text/javascript">
$(function($) {
/*
var page = new PDFFormFiller.Page(),
preview = new PDFFormFiller.PagePreviewView({
el: $('#pff'),
model: page
});
page.url = '{% url "pdfformfiller_api_document_detail" id=document.id %}';
page.fetch();
*/
var doc = new PDFFormFiller.Document({id: {{ document.id }}});
doc.url = "{% url 'pdfformfiller_api_document_detail' id=document.id %}";
window.doc = doc;
})
</script>
{% url "pdfformfiller_api_document_detail" id=document.id %}
<div id="content-main">
<div id="pff"></div>
</div>
{% endblock %}