-
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.
- Loading branch information
Showing
27 changed files
with
515 additions
and
492 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"pytestmark", | ||
"ratelimit", | ||
"SIGNUP", | ||
"svgwrite", | ||
"WAGTAILADMIN", | ||
"wagtailcore" | ||
] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% load i18n %} | ||
|
||
<form | ||
action="{{ request.path }}" | ||
method="POST" | ||
hx-post="{{ request.path }}" | ||
hx-target="this" | ||
hx-swap="outerHTML" | ||
class="form" | ||
> | ||
{% csrf_token %} | ||
<div class="mb-4"> | ||
<div id="wmd-button-bar-edit-comment-{{ activity.id }}" class="wmd-button-bar not-prose"></div> | ||
|
||
<textarea | ||
id="wmd-input-edit-comment-{{ activity.id }}" | ||
class="wmd-input w-full not-prose" | ||
rows="10" name="message" | ||
>{{ activity.message }}</textarea> | ||
|
||
<div id="wmd-preview-edit-comment-{{ activity.id }}" class="w-full bg-gray-100 p-4 prose max-w-none shadow-sm"></div> | ||
</div> | ||
|
||
<div class="flex gap-2"> | ||
<button class="button button--primary" role="button" type="submit">{% trans "Submit" %}</button> | ||
<button class="button" hx-get="{{ request.path}}?action=cancel">{% trans "Cancel" %}</button> | ||
</div> | ||
|
||
<script> | ||
(function(){ | ||
const initEditor = (id) => { | ||
const converterOne = window.Markdown.getSanitizingConverter(); | ||
const commentEditor = new window.Markdown.Editor(converterOne,id); | ||
commentEditor.run(); | ||
}; | ||
initEditor("-edit-comment-{{ activity.id }}"); | ||
})(); | ||
</script> | ||
|
||
</form> | ||
|
30 changes: 24 additions & 6 deletions
30
hypha/apply/activity/templates/activity/include/comment_list.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 |
---|---|---|
@@ -1,9 +1,27 @@ | ||
{% load i18n %} | ||
|
||
{% for comment in comments %} | ||
{% include "activity/include/listing_base.html" with activity=comment %} | ||
{% endfor %} | ||
<div class="border-b-2 border-b-slate-300"> | ||
<div class="max-w-3xl ml-4 md:ml-20"> | ||
<div class="comment-list-content"> | ||
{% for comment in comments %} | ||
{% include "activity/include/listing_base.html" with activity=comment %} | ||
{% endfor %} | ||
|
||
{% if not comments %} | ||
{% trans "No comments available" %} | ||
{% endif %} | ||
{% if page.has_next %} | ||
<a | ||
href="{{ request.path }}?page={{ page.next_page_number }}" | ||
class="block text-sm text-slate-500 hover:text-slate-700 py-2" | ||
hx-get="{{ request.path }}?page={{ page.next_page_number }}" | ||
hx-trigger="revealed" | ||
hx-target="this" | ||
hx-swap="outerHTML" | ||
hx-select=".comment-list-content" | ||
>Show more...</a> | ||
{% endif %} | ||
</div> | ||
|
||
{% if not comments %} | ||
{% trans "No comments available" %} | ||
{% endif %} | ||
</div> | ||
</div> |
180 changes: 91 additions & 89 deletions
180
hypha/apply/activity/templates/activity/include/listing_base.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
32 changes: 32 additions & 0 deletions
32
hypha/apply/activity/templates/activity/partial_comment_message.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,32 @@ | ||
{% load heroicons activity_tags nh3_tags markdown_tags submission_tags apply_tags users_tags %} | ||
|
||
<div class="prose max-w-none"> | ||
{{ activity|display_for:request.user|submission_links|markdown|nh3 }} | ||
</div> | ||
|
||
{% if activity.edited %} | ||
<span class="text-fg-muted text-sm" data-tippy-content="{{ activity.edited|date:"SHORT_DATETIME_FORMAT" }}">(edited)</span> | ||
{% endif %} | ||
|
||
{% with activity.attachments.all as attachments %} | ||
{% if attachments %} | ||
<div class="section-attachments flex gap-2 flex-col max-w-xl mt-4 pb-2"> | ||
{% for attachment in attachments %} | ||
<a href="{{attachment.get_absolute_url }}" | ||
class="flex justify-between border rounded px-3 py-2 font-medium bg-slate-50 hover:bg-slate-200 transition-colors" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
title="{{ attachment.filename }}" | ||
> | ||
<span class="truncate text-sm"> | ||
{% heroicon_mini "paper-clip" class="inline align-text-bottom" aria_hidden=true %} | ||
{{ attachment.filename|truncatechars_middle:45 }} | ||
</span> | ||
<span> | ||
{% heroicon_mini "arrow-small-down" class="inline align-text-bottom rounded" aria_hidden=true %} | ||
</span> | ||
</a> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
{% endwith %} |
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
Oops, something went wrong.