-
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.
Separate SOW & PAF form editing (#4261)
Fixes #4204. Moves the SOW out into it's own form when editing. This also removes the `user_has_updated_details` attribute in favor of using a property for both the project form & SOW that checks the field_data on the respective form. This allows for tracking of the project form & SOW independently. Also a few small aesthetic changes bundled in, like margin additions & hiding of submission attachments sidebar when there's none. --------- Co-authored-by: Fredrik Jonsson <[email protected]>
- Loading branch information
Showing
21 changed files
with
396 additions
and
239 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
16 changes: 16 additions & 0 deletions
16
hypha/apply/projects/migrations/0094_remove_project_user_has_updated_pf_details.py
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,16 @@ | ||
# Generated by Django 4.2.16 on 2024-12-06 16:39 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("application_projects", "0093_remove_reportversion_form_fields"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="project", | ||
name="user_has_updated_details", | ||
), | ||
] |
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
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
76 changes: 76 additions & 0 deletions
76
hypha/apply/projects/templates/application_projects/project_sow_form.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,76 @@ | ||
{% extends "base-apply.html" %} | ||
{% load i18n static %} | ||
{% block title %}{% trans "Editing" %}: {{object.title }}{% endblock %} | ||
{% block content %} | ||
|
||
{% adminbar %} | ||
{% slot back_link %} | ||
<a class="simplified__projects-link" href="{{ object.get_absolute_url }}"> | ||
{% trans "View project page" %} | ||
</a> | ||
{% endslot %} | ||
{% slot header %}{% trans "Editing" %}: {{ object.title }}{% endslot %} | ||
{% endadminbar %} | ||
|
||
{% if sow_form_exists %} | ||
{% include "forms/includes/form_errors.html" with form=sow_form %} | ||
<div class="pt-8 pb-8 mx-auto mt-4 mb-12 wrapper wrapper--default-bg wrapper--sidebar ps-20 "> | ||
<div class="wrapper--sidebar--inner"> | ||
<form class="form application-form" action="" method="post" enctype="multipart/form-data"> | ||
{% csrf_token %} | ||
{{ sow_form.media }} | ||
{% for field in sow_form %} | ||
{% if field.field %} | ||
{% if field.field.multi_input_field %} | ||
{% include "forms/includes/multi_input_field.html" %} | ||
{% else %} | ||
{% include "forms/includes/field.html" %} | ||
{% endif %} | ||
{% else %} | ||
{{ field.block }} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
|
||
{% for hidden_field in sow_form.hidden_fields %} | ||
{{ hidden_field }} | ||
{% endfor %} | ||
{% trans "Save draft" as save_draft %} | ||
{% for button_name, button_type, button_value in buttons %} | ||
<button class="button button--submit button--top-space button--{{ button_type }}" type="submit" name="{{ button_name }}" {% if button_value == save_draft %}formnovalidate{% endif %}>{{ button_value }}</button> | ||
{% endfor %} | ||
</form> | ||
</div> | ||
<aside class="sidebar sidebar__project"> | ||
{% if submissions_attachments %} | ||
<div class="js-actions-sidebar sidebar__inner sidebar__inner--actions {% if mobile %}sidebar__inner--mobile{% endif %}"> | ||
<h5>{% trans "Proposal attachments" %}</h5> | ||
{% for file in submissions_attachments %} | ||
<p><b><a href="{{ file.url }}" target="_blank">{{ file.filename }}</a></b></p> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
</aside> | ||
</div> | ||
{% else %} | ||
<div class="wrapper wrapper--default-bg wrapper--form wrapper--sidebar"> | ||
<div class="wrapper--sidebar--inner"> | ||
<p> | ||
{% trans "Scope of work form not configured. Please add it in the" %} | ||
<a href="{% url 'wagtailadmin_pages:edit' object.submission.page.id %}" target="_blank">{% trans "fund settings" %}</a>. | ||
</p> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
{% endblock %} | ||
|
||
{% block extra_js %} | ||
<script src="{% static 'js/file-uploads.js' %}"></script> | ||
<script src="{% static 'js/tinymce-word-count.js' %}"></script> | ||
<script src="{% static 'js/multi-input-fields.js' %}"></script> | ||
<script src="{% static 'js/application-form-links-new-window.js' %}"></script> | ||
{% if not show_all_group_fields %} | ||
<script src="{% static 'js/form-group-toggle.js' %}"></script> | ||
{% endif %} | ||
{% endblock %} |
Oops, something went wrong.