-
Notifications
You must be signed in to change notification settings - Fork 41
Add a comments sidebar & associate comments to specific objects #4923
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7214f07
Initial implementation for a comments sidebar on reports, invoices, P…
wes-otf deabb5f
Removed unneeded InvoiceDetailView
wes-otf 5d75777
Fix PAF status retrieval issues, handle no fetch URL being provided
wes-otf 4eff25d
Removed CommentFormMini in favor of using init args
wes-otf 537e2ce
fixed migrations
wes-otf f3cb71b
Squashed migrations
wes-otf e0ab374
Added more unit tests
wes-otf e4a3673
Various fixes: changed `an` tag to be more verbose + unit test adds, …
wes-otf 892893b
Fix translations issues.
frjo 4d1304d
Fix translating an_or_a.
frjo b7a290d
Missing translation.
frjo 32e674a
Create get_object_for_content_type support function to avoid duplicat…
frjo 7a6d639
Move support functions _get_object_activity and _get_object_for_conte…
frjo 9e6681a
Missing translation.
frjo 793c2fd
Add @require_GET to all partial views.
frjo 56b666f
Make sure partials only show content the user are allowed to see.
frjo 47b53d8
Fix annotation on _get_object_activity.
frjo d33bf9e
Field related_content_type already renderd by hidden_fields.
frjo 5f981d9
Only show comment form to staff.
frjo cb52812
linting fixes
wes-otf 04dd1c3
Merge branch 'main' into feature/comments-on-specific-objects
wes-otf 72eaffb
Fix invoice test URL
wes-otf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
37 changes: 37 additions & 0 deletions
37
hypha/apply/activity/templates/activity/partials/comment_form.html
This file contains hidden or 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,37 @@ | ||
| {% comment %} | ||
| Renders the sidebar comments form. | ||
|
|
||
| Params: | ||
| form – the CommentForm form | ||
| {% endcomment %} | ||
|
|
||
| {% load i18n static heroicons %} | ||
|
|
||
| {# On error the view re-renders this whole form, so swap outerHTML on self to avoid nesting a form inside itself. A successful post returns 204 and is not swapped. #} | ||
| <form hx-post="{% url 'activity:post-comment' %}" hx-target="this" hx-swap="outerHTML" class="flex flex-col gap-2 p-2 card-body" hx-on::after-request="if(event.detail.xhr.status === 204) this.reset()"> | ||
| <h2 class="card-title">{% trans "Comment" %}</h2> | ||
| {% csrf_token %} | ||
|
|
||
| {% for hidden in form.hidden_fields %} | ||
| {{ hidden }} | ||
| {% endfor %} | ||
| <div> | ||
| {% include "forms/includes/field.html" with field=form.message label_classes="sr-only" %} | ||
| </div> | ||
|
|
||
| <details class="mb-1 collapse bg-base-100 group"> | ||
| <summary class="flex gap-1.5 items-center text-sm collapse-title"><span>{% trans 'Additional options' %}</span>{% heroicon_mini 'chevron-down' class="size-5 group-open:-rotate-180" %}</summary> | ||
| {# Some small modifications to django-file-form to make it fit better with the smaller modal #} | ||
| <div class="collapse-content [&_.dff-uploader]:hidden [&_.btn-upload]:w-full"> | ||
| {% include "forms/includes/field.html" with field=form.visibility %} | ||
| {% include "forms/includes/field.html" with field=form.assign_to %} | ||
| {% include "forms/includes/field.html" with field=form.attachments %} | ||
| </div> | ||
| </details> | ||
| <button | ||
| class="btn btn-primary" | ||
| type="submit" | ||
| > | ||
| {% trans "Add Comment" %} | ||
| </button> | ||
| </form> |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.