-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add server side previews to the application workflow (#3725)
## Description Closes #3545. This creates the option to require a user to preview their form before submitting it. The requirement is set on a per fund/lab basis, and is a ~required checkbox when the lab/fund is configured in Wagtail admin~ global Django configuration option. The preview first saves the application as a draft, then presents the user with a preview of their application. Upon viewing, the user can either edit or submit as seen in the flow diagram below.
- Loading branch information
Showing
8 changed files
with
181 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
hypha/apply/funds/templates/funds/application_preview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{% extends "base-apply.html" %} | ||
{% load wagtailcore_tags static i18n util_tags heroicons %} | ||
{% block title %}{% trans "Previewing" %}: {{object.title }}{% endblock %} | ||
{% block body_class %}bg-white{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% adminbar %} | ||
{% slot header %}{% trans "Previewing" %}: {{ object.title }}{% endslot %} | ||
{% endadminbar %} | ||
|
||
<div class="wrapper wrapper--medium wrapper--form"> | ||
{% include "funds/includes/rendered_answers.html" %} | ||
|
||
<form id="preview-form-submit" class="form application-form" action="{% url 'funds:submissions:edit' object.id %}" method="POST" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
|
||
<div class="preview-hidden-form" hidden> | ||
{% for field in form %} | ||
{% if field.field %} | ||
{% if field.field.multi_input_field %} | ||
{% include "forms/includes/multi_input_field.html" with is_application=True %} | ||
{% else %} | ||
{% include "forms/includes/field.html" with is_application=True %} | ||
{% endif %} | ||
{% else %} | ||
{{ field.block }} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
<!-- <button class="button button--primary" name="submit" type="submit">{% trans "Submit for review" %}</button> --> | ||
</form> | ||
|
||
<form id="preview-form-edit" class="form application-form" action="{% url 'funds:submissions:edit' object.id %}"> | ||
{% csrf_token %} | ||
</form> | ||
|
||
<div class="form__group"> | ||
<button class="button button--primary" form="preview-form-submit" name="submit" type="submit">{% trans "Submit for review" %}</button> | ||
<button class="button button--secondary" form="preview-form-edit">{% trans "Edit" %}</button> | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters