-
Notifications
You must be signed in to change notification settings - Fork 39
Add author updated feature to submission #4380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Generated by Django 4.2.18 on 2025-02-06 04:38 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("activity", "0086_remove_django_messages_adapter"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="event", | ||
| name="type", | ||
| field=models.CharField( | ||
| choices=[ | ||
| ("UPDATE_LEAD", "updated lead"), | ||
| ("BATCH_UPDATE_LEAD", "batch updated lead"), | ||
| ("EDIT_SUBMISSION", "edited submission"), | ||
| ("APPLICANT_EDIT", "edited applicant"), | ||
| ("NEW_SUBMISSION", "submitted new submission"), | ||
| ("DRAFT_SUBMISSION", "submitted new draft submission"), | ||
| ("SCREENING", "screened"), | ||
| ("TRANSITION", "transitioned"), | ||
| ("BATCH_TRANSITION", "batch transitioned"), | ||
| ("DETERMINATION_OUTCOME", "sent determination outcome"), | ||
| ("BATCH_DETERMINATION_OUTCOME", "sent batch determination outcome"), | ||
| ("INVITED_TO_PROPOSAL", "invited to proposal"), | ||
| ("REVIEWERS_UPDATED", "updated reviewers"), | ||
| ("BATCH_REVIEWERS_UPDATED", "batch updated reviewers"), | ||
| ("PARTNERS_UPDATED", "updated partners"), | ||
| ("PARTNERS_UPDATED_PARTNER", "partners updated partner"), | ||
| ("READY_FOR_REVIEW", "marked ready for review"), | ||
| ("BATCH_READY_FOR_REVIEW", "marked batch ready for review"), | ||
| ("NEW_REVIEW", "added new review"), | ||
| ("COMMENT", "added comment"), | ||
| ("PROPOSAL_SUBMITTED", "submitted proposal"), | ||
| ("OPENED_SEALED", "opened sealed submission"), | ||
| ("REVIEW_OPINION", "reviewed opinion"), | ||
| ("DELETE_SUBMISSION", "deleted submission"), | ||
| ("DELETE_REVIEW", "deleted review"), | ||
| ("DELETE_REVIEW_OPINION", "deleted review opinion"), | ||
| ("CREATED_PROJECT", "created project"), | ||
| ("UPDATE_PROJECT_LEAD", "updated project lead"), | ||
| ("UPDATE_PROJECT_TITLE", "updated project title"), | ||
| ("EDIT_REVIEW", "edited review"), | ||
| ("SEND_FOR_APPROVAL", "sent for approval"), | ||
| ("APPROVE_PROJECT", "approved project"), | ||
| ("ASSIGN_PAF_APPROVER", "assign project form approver"), | ||
| ("APPROVE_PAF", "approved project form"), | ||
| ("PROJECT_TRANSITION", "transitioned project"), | ||
| ("REQUEST_PROJECT_CHANGE", "requested project change"), | ||
| ("SUBMIT_CONTRACT_DOCUMENTS", "submitted contract documents"), | ||
| ("UPLOAD_DOCUMENT", "uploaded document to project"), | ||
| ("UPLOAD_CONTRACT", "uploaded contract to project"), | ||
| ("APPROVE_CONTRACT", "approved contract"), | ||
| ("CREATE_INVOICE", "created invoice for project"), | ||
| ("UPDATE_INVOICE_STATUS", "updated invoice status"), | ||
| ("APPROVE_INVOICE", "approve invoice"), | ||
| ("DELETE_INVOICE", "deleted invoice"), | ||
| ("SENT_TO_COMPLIANCE", "sent project to compliance"), | ||
| ("UPDATE_INVOICE", "updated invoice"), | ||
| ("SUBMIT_REPORT", "submitted report"), | ||
| ("SKIPPED_REPORT", "skipped report"), | ||
| ("REPORT_FREQUENCY_CHANGED", "changed report frequency"), | ||
| ("DISABLED_REPORTING", "disabled reporting"), | ||
| ("REPORT_NOTIFY", "notified report"), | ||
| ("REVIEW_REMINDER", "reminder to review"), | ||
| ("BATCH_DELETE_SUBMISSION", "batch deleted submissions"), | ||
| ("BATCH_ARCHIVE_SUBMISSION", "batch archive submissions"), | ||
| ("BATCH_INVOICE_STATUS_UPDATE", "batch update invoice status"), | ||
| ("STAFF_ACCOUNT_CREATED", "created new account"), | ||
| ("STAFF_ACCOUNT_EDITED", "edited account"), | ||
| ("ARCHIVE_SUBMISSION", "archived submission"), | ||
| ("UNARCHIVE_SUBMISSION", "unarchived submission"), | ||
| ("REMOVE_TASK", "remove task"), | ||
| ("UPDATED_AUTHOR", "updated author"), | ||
| ], | ||
| max_length=50, | ||
| verbose_name="verb", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| {% extends "messages/email/applicant_base.html" %} | ||
|
|
||
| {% load i18n %} | ||
|
|
||
| {% block content %}{# fmt:off #} | ||
| {% blocktrans with title=source.title %}You have assigned as an Applicant to submission "{{ title }}".{% endblocktrans %} | ||
| {% endblock %} | ||
|
|
||
| {% block more_info %} | ||
| {% trans "Link to your submission" %}: {{ request.scheme }}://{{ request.get_host }}{{ source.get_absolute_url }} | ||
| {% trans "If you have any questions, please submit them here" %}: {{ request.scheme }}://{{ request.get_host }}{{ source.get_absolute_url }}#communications | ||
|
|
||
| {% trans "See our guide for more information" %}: {{ ORG_GUIDE_URL }} | ||
|
|
||
| {% blocktrans %}If you have any issues accessing the submission or other general inquiries, please email us at {{ ORG_EMAIL }}{% endblocktrans %} | ||
| {% endblock %}{# fmt:on #} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| {% load i18n static %} | ||
| {% modal_title %}{% trans "Update Author" %}{% endmodal_title %} | ||
|
|
||
| <form | ||
| class="p-4 form" | ||
| id="author_form" | ||
| hx-target="this" | ||
| hx-swap="outerHTML" | ||
| method="POST" | ||
| hx-post="{% url 'funds:submissions:change_author' pk=object.pk %}" | ||
| > | ||
| <div> | ||
| <dl class="mb-4"> | ||
| <dt class="font-semibold">{% trans "Current Author" %}</dt> | ||
| <dd class="truncate">{{ object.user }} <{{object.user.email}}></dd> | ||
| </dl> | ||
| </div> | ||
|
|
||
| {% url 'funds:submissions:change_author' pk=object.pk as author_update_url %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think this is used anywhere. |
||
| {% include 'funds/includes/dialog_form_base.html' with form=form value=value %} | ||
| </form> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "lead" modal is much simpler, no form in form. Here there seems to be two htmx calls, is that needed? I see that the partner modal looks like above, I suspect that is overcomplicated as well. |
||
|
|
||
|
|
||
| <script type="module"> | ||
| {% comment %} Do this here as the select elements for partners are dynamically generated. {% endcomment %} | ||
| import Choices from "{% static 'js/esm/choices.js-10-2-0.js' %}"; | ||
|
|
||
| const selectElements = document.querySelectorAll('#author_form select'); | ||
|
|
||
| // add choices to all select elements | ||
| selectElements.forEach((selectElement) => { | ||
| new Choices(selectElement, { | ||
| removeItemButton: true, | ||
| allowHTML: true, | ||
| }); | ||
| }); | ||
| </script> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With setting |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this
author.widget.attrs.update({"data-placeholder": "Select...", "data-js-choices": ""})?