Finished converting project to the new subtemplate rendering

This commit is contained in:
Roberto Rosario
2011-05-11 22:08:52 -04:00
parent 5a0ae2eb32
commit 2162e99543
11 changed files with 287 additions and 476 deletions

View File

@@ -10,28 +10,26 @@
{% include subtemplate %}
</div>
{% endfor %}
{% for subtemplate in sidebar_subtemplates_dict %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% with subtemplate.hide_columns as hide_columns %}
{% with "true" as side_bar %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% for subtemplate in sidebar_subtemplates_list %}
{% with "true" as side_bar %}
{% if subtemplate.form %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{% with "true" as read_only %}
<div class="generic_subform">
{{ rendered_subtemplate }}
</div>
{% endwith %}
{% else %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{{ rendered_subtemplate }}
{% endif %}
</div>
{% if subtemplate.grid_clear or not subtemplate.grid %}
<div class=""></div>
{% endif %}
{% endwith %}
{% endfor %}
{% endblock %}
{% block stylesheets %}
@@ -45,83 +43,38 @@
{% endblock %}
{% block content %}
<div class="container_12">
<div class="">
{% if form %}
{% with "true" as read_only %}
<div class="grid_{{ grid|default:11 }}">
<div class="">
<div class="generic_subform">
{% include "generic_form_subtemplate.html" %}
</div>
</div>
{% if grid_clear or not grid %}
<div class="clear"></div>
<div class=""></div>
{% endif %}
{% endwith %}
{% endif %}
{% for subtemplate in subtemplates %}
{% include subtemplate %}
{% endfor %}
{% for form in form_list %}
{% with form.submit_method as submit_method %}
{% with form.striptags as striptags %}
{% with form.title as title %}
{% with form.object as object %}
{% with form.object_name as object_name %}
{% with form.form_action as form_action %}
{% with "true" as read_only %}
<div class="grid_{{ form.grid|default:11 }}">
{% with form.form as form %}
<div class="generic_subform">
{% include "generic_form_subtemplate.html" %}
</div>
{% endwith %}
</div>
{% if form.grid_clear or not form.grid %}
<div class="clear"></div>
{% endif %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% for subtemplate in subtemplates_list %}
<div class="grid_{{ subtemplate.grid|default:11 }}">
{% if subtemplate.form %}
{% with subtemplate.submit_method as submit_method %}
{% with subtemplate.striptags as striptags %}
{% with subtemplate.object as object %}
{% with subtemplate.object_name as object_name %}
{% with subtemplate.form_action as form_action %}
{% with "true" as read_only %}
{% with subtemplate.form as form %}
<div class="generic_subform">
{% include subtemplate.name %}
</div>
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% else %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{{ rendered_subtemplate }}
{% endif %}
</div>
{% if subtemplate.grid_clear or not subtemplate.grid %}
<div class="clear"></div>
<div class="">
{% if subtemplate.form %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{% with "true" as read_only %}
<div class="generic_subform">
{{ rendered_subtemplate }}
</div>
{% endwith %}
{% else %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{{ rendered_subtemplate }}
{% endif %}
</div>
{% if subtemplate.grid_clear or not subtemplate.grid %}
<div class=""></div>
{% endif %}
{% endfor %}
</div>
{% endblock %}

View File

@@ -19,49 +19,5 @@
</div><!--end generic_subform-->
{% endwith %}
{% endif %}
{% for subtemplate in subtemplates %}
{% include subtemplate %}
{% endfor %}
{% for form in form_list %}
{% with form.submit_method as submit_method %}
{% with form.striptags as striptags %}
{% with form.title as title %}
{% with form.object as object %}
{% with form.object_name as object_name %}
{% with form.form_action as form_action %}
{% with "true" as read_only %}
{% with form.form as form %}
{% include "generic_form_subtemplate.html" %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% for subtemplate in subtemplates_dict %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endblock %}

View File

@@ -1,116 +1,51 @@
{% extends "base.html" %}
{% load subtemplates_tags %}
{% block title %} :: {% with "true" as striptags %}{% include "calculate_form_title.html" %}{% endwith %}{% endblock %}
{% block sidebar %}
{% for subtemplate in sidebar_subtemplates %}
<div class="generic_subform">
{% include subtemplate %}
</div><!--end subform-->
{% endfor %}
{% for subtemplate in sidebar_subtemplates_list %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% with subtemplate.hide_columns as hide_columns %}
{% with "true" as side_bar %}
{% with subtemplate.submit_method as submit_method %}
{% with subtemplate.striptags as striptags %}
{% with subtemplate.title as title %}
{% with subtemplate.object as object %}
{% with subtemplate.object_name as object_name %}
{% with subtemplate.form_action as form_action %}
{% with subtemplate.submit_label as submit_label %}
{% with subtemplate.form as form %}
{% with subtemplate.content as content %}
{% with subtemplate.paragraphs as paragraphs %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% if subtemplate.form %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
<div class="generic_subform">
{{ rendered_subtemplate }}
</div>
{% else %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{{ rendered_subtemplate }}
{% endif %}
{% if subtemplate.grid_clear or not subtemplate.grid %}
{% endif %}
{% endfor %}
{% endblock %}
{% block content %}
<div class="container_12">
{% if form %}
<div class="grid_{{ form.grid|default:11 }}">
{% include "generic_form_subtemplate.html" %}
</div>
{% if form.grid_clear or not form.grid %}
<div class="clear"></div>
{% endif %}
{% endif %}
{% for form in form_list %}
{% with form.submit_method as submit_method %}
{% with form.striptags as striptags %}
{% with form.title as title %}
{% with form.object as object %}
{% with form.object_name as object_name %}
{% with form.submit_label as submit_label %}
{% with form.form_action as form_action %}
<div class="grid_{{ form.grid|default:11 }}">
{% with form.form as form %}
{% include "generic_form_subtemplate.html" %}
{% endwith %}
<div class="">
{% if form %}
<div class="">
{% include "generic_form_subtemplate.html" %}
</div>
{% if form.grid_clear or not form.grid %}
<div class="clear"></div>
<div class=""></div>
{% endif %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
</div>
{% endif %}
{% for subtemplate in subtemplates_dict %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% for subtemplate in subtemplates_list %}
<div class="">
{% if subtemplate.form %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
<div class="generic_subform">
{{ rendered_subtemplate }}
</div>
{% else %}
{% render_subtemplate subtemplate.name subtemplate.context as rendered_subtemplate %}
{{ rendered_subtemplate }}
{% endif %}
</div>
{% if subtemplate.grid_clear or not subtemplate.grid %}
<div class=""></div>
{% endif %}
{% endfor %}
</div>
{% endblock %}

View File

@@ -4,84 +4,16 @@
{% block title %} :: {% blocktrans %}List of {{ title }}{% endblocktrans %}{% endblock %}
{#{% block secondary_links %}{{ secondary_links|safe }}{% endblock %}#}
{% block sidebar %}
{% for subtemplate in sidebar_subtemplates %}
<div class="generic_subform">
{% include subtemplate %}
</div><!--end subform-->
{% endfor %}
{% for subtemplate in sidebar_subtemplates_list %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% with subtemplate.hide_columns as hide_columns %}
{% with "true" as side_bar %}
{% with subtemplate.submit_method as submit_method %}
{% with subtemplate.striptags as striptags %}
{% with subtemplate.title as title %}
{% with subtemplate.object as object %}
{% with subtemplate.object_name as object_name %}
{% with subtemplate.form_action as form_action %}
{% with subtemplate.form as form %}
{% with subtemplate.content as content %}
{% with subtemplate.paragraphs as paragraphs %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endblock %}
{% block content %}
{% include "generic_list_subtemplate.html" %}
{% for subtemplate in subtemplates_dict %}
{% with subtemplate.title as title %}
{% with subtemplate.object_list as object_list %}
{% with subtemplate.extra_columns as extra_columns %}
{% with subtemplate.hide_object as hide_object %}
{% with subtemplate.main_object as main_object %}
{% with subtemplate.hide_link as hide_link %}
{% with subtemplate.hide_header as hide_header %}
{% with subtemplate.multi_select as multi_select %}
{% include subtemplate.name %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endblock %}