Commit f82fa2e3 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Giorgos Korfiatis

astakos: Separate templates in project creation

instead of including application form summary template in the application form
view, render it from scratch. This resolves a bug caused when using django>1.2
since block tags within the included templates are not supported.

Conflicts:
	snf-astakos-app/astakos/im/views/util.py
parent 31ea74ca
......@@ -9,17 +9,9 @@
{% block page.body %}
<h2>
{% if update_form %}REQUEST PROJECT MODIFICATION{% else %}REQUEST PROJECT{% endif %}
{% if update_form %}REQUEST PROJECT MODIFICATION{% else %}REQUEST PROJECT{% endif %}
</h2>
{% if not show_form %}
<p>These are the specifications of the Project you want to create. If you hit the "Submit" button
this form will be officially sent to {{ BRANDING_COMPANY_NAME }} for review. Please make sure the following reflect
exactly your request.</p>
{% endif %}
{% if show_form %}
<form action="?verify=1" method="post" class="withlabels quotas-form" id="group_create_form">{% csrf_token %}
<fieldset class="with-info" id="top">
......@@ -191,12 +183,4 @@ exactly your request.</p>
<input type="submit" value="CONTINUE" class="submit altcol" >
</div>
</form>
{% else %}
{% include "im/projects/projectapplication_form_summary.html" %}
{% endif %}
<script>
</script>
{% endblock %}
{% load filters %}
{% extends "im/account_base.html" %}
{% load filters astakos_tags %}
{% block headjs %}
{{ block.super }}
<script src="{{ IM_STATIC_URL }}js/quotas.js"></script>
{% endblock %}
{% block page.body %}
<h2>
{% if update_form %}REQUEST PROJECT MODIFICATION{% else %}REQUEST PROJECT{% endif %}
</h2>
<p>These are the specifications of the Project you want to create. If you hit the "Submit" button
this form will be officially sent to {{ BRANDING_COMPANY_NAME }} for review. Please make sure the following reflect
exactly your request.</p>
<div class="projects summary">
<form action="?edit=0&verify=0" method="post" class="quotas-form">{% csrf_token %}
{% for k,v in request.POST.items %}
......@@ -76,9 +86,4 @@
</div>
<script>
</script>
{% endblock %}
......@@ -129,6 +129,7 @@ def create_app_object(request, extra_context=None):
return _create_object(
request,
template_name='im/projects/projectapplication_form.html',
summary_template_name='im/projects/projectapplication_form_summary.html',
extra_context=extra_context,
post_save_redirect=reverse('project_list'),
form_class=ProjectApplicationForm,
......@@ -269,6 +270,7 @@ def update_app_object(request, object_id, extra_context=None):
request,
object_id=object_id,
template_name='im/projects/projectapplication_form.html',
summary_template_name='im/projects/projectapplication_form_summary.html',
extra_context=extra_context,
post_save_redirect=reverse('project_list'),
form_class=ProjectApplicationForm,
......
......@@ -86,7 +86,8 @@ def render_response(template, tab=None, status=200, context_instance=None,
def _create_object(request, model=None, template_name=None,
template_loader=template_loader, extra_context=None,
post_save_redirect=None, login_required=False,
context_processors=None, form_class=None, msg=None):
context_processors=None, form_class=None, msg=None,
summary_template_name=None):
"""
Based of django.views.generic.create_update.create_object which displays a
summary page before creating the object.
......@@ -107,6 +108,7 @@ def _create_object(request, model=None, template_name=None,
if verify == '1':
extra_context['show_form'] = False
extra_context['form_data'] = form.cleaned_data
template_name = summary_template_name
elif edit == '1':
extra_context['show_form'] = True
else:
......@@ -137,7 +139,7 @@ def _update_object(request, model=None, object_id=None, slug=None,
template_loader=template_loader, extra_context=None,
post_save_redirect=None, login_required=False,
context_processors=None, template_object_name='object',
form_class=None, msg=None):
form_class=None, msg=None, summary_template_name=None):
"""
Based of django.views.generic.create_update.update_object which displays a
summary page before updating the object.
......@@ -159,6 +161,7 @@ def _update_object(request, model=None, object_id=None, slug=None,
if verify == '1':
extra_context['show_form'] = False
extra_context['form_data'] = form.cleaned_data
template_name = summary_template_name
elif edit == '1':
extra_context['show_form'] = True
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment