This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #481 from communitiesuk/FS-3705-Assessor-comment-e…
…diting Fs 3705 assessor comment editing
- Loading branch information
Showing
10 changed files
with
182 additions
and
27 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
30 changes: 30 additions & 0 deletions
30
app/blueprints/assessments/templates/macros/comments_edit_box.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,30 @@ | ||
{% from "macros/comments_box.html" import comment_box %} | ||
|
||
{% macro edit_comment_box(comments, comment_id, comment_form) %} | ||
|
||
{# Using namespace objects to access variables set outside of for loop #} | ||
{% set comment_text = namespace(str = "") %} | ||
{% set comment_author = namespace(str = "") %} | ||
{% set comment_date = namespace(str = "") %} | ||
|
||
{% for comment_list in comments.values() %} | ||
{% for comment in comment_list %} | ||
{% if comment.id == comment_id %} | ||
{% set comment_text.str = comment.updates[-1]['comment'] %} | ||
{% set comment_author.str = comment.full_name + " (" + comment.highest_role|all_caps_to_human + ") "+ comment.email_address %} | ||
{% set comment_date.str = comment.date_created|utc_to_bst %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
{% set HtmlData %} | ||
<h2 class="govuk-heading-m govuk-!-margin-bottom-2">Edit comment</h2> | ||
<div class="comment-group"> | ||
<p class="govuk-body">{{ comment_text.str }}</p> | ||
<p class="govuk-body-s">{{ comment_author.str }}</p> | ||
<p class="govuk-body-s">{{ comment_date.str }}</p> | ||
</div> | ||
{% endset %} | ||
|
||
{{ comment_box(comment_form, HtmlData, comment_text.str) }} | ||
{% endmacro %} |
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