-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actions: register notification for the 'review' action
- Loading branch information
Showing
4 changed files
with
103 additions
and
3 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
76 changes: 76 additions & 0 deletions
76
invenio_curations/templates/semantic-ui/invenio_notifications/curation-request.review.jinja
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 @@ | ||
{% set curation_request = notification.context.request %} | ||
{% set group = curation_request.receiver %} | ||
{% set creator = curation_request.created_by %} | ||
{% set record = curation_request.topic %} | ||
{% set request_id = curation_request.id %} | ||
{% set executing_user = notification.context.executing_user %} | ||
{% set message = notification.context.message | safe if notification.context.message else '' %} | ||
{% set record_title = record.metadata.title %} | ||
{% set curator_name = executing_user.username or executing_user.profile.full_name %} | ||
|
||
{# TODO: use request.links.self_html when issue issue is resolved: https://github.com/inveniosoftware/invenio-rdm-records/issues/1327 #} | ||
{% set request_link = "{ui}/me/requests/{id}".format( | ||
ui=config.SITE_UI_URL, id=request_id | ||
) | ||
%} | ||
{% set account_settings_link = "{ui}/account/settings/notifications".format( | ||
ui=config.SITE_UI_URL | ||
) | ||
%} | ||
|
||
{%- block subject -%} | ||
{{ _("👁️ Review started for '{record_title}'").format(record_title=record_title) }} | ||
{%- endblock subject -%} | ||
|
||
{%- block html_body -%} | ||
<table style="font-family:'Lato',Helvetica,Arial,sans-serif;border-spacing:15px"> | ||
<tr> | ||
<td>{{ _("The metadata curator '@{curator_name}' started reviewing the record '{record_title}'").format(curator_name=curator_name, record_title=record_title) }} | ||
{% if message %} | ||
{{ _(" with the following message:")}} | ||
{% endif %} | ||
</td> | ||
</tr> | ||
<tr> | ||
{% if message %} | ||
<td><em>{{message}}</em></td> | ||
{% endif %} | ||
</tr> | ||
<tr> | ||
<td><a href="{{ request_link }}" class="button">{{ _("Check out the curation request")}}</a></td> | ||
</tr> | ||
<tr> | ||
<td><strong>_</strong></td> | ||
</tr> | ||
<tr> | ||
<td style="font-size:smaller">{{ _("This is an auto-generated message. To manage notifications, visit your")}} <a href="{{account_settings_link}}">{{ _("account settings")}}</a>.</td> | ||
</tr> | ||
</table> | ||
{%- endblock html_body %} | ||
|
||
{%- block plain_body -%} | ||
{{ _("The metadata curator @{curator_name} started reviewing the record '{record_title}'").format(curator_name=curator_name, record_title=record_title) }} | ||
|
||
{% if message %} | ||
{{ _("with the following message:")}} | ||
{{message}} | ||
{% endif %} | ||
|
||
[{{ _("Check out the curation request") }}]({{ request_link }}) | ||
|
||
{{ _("This is an auto-generated message. To manage notifications, visit your account settings")}} | ||
{%- endblock plain_body %} | ||
|
||
{# Markdown for Slack/Mattermost/chat #} | ||
{%- block md_body -%} | ||
{{ _("The metadata curator *@{curator_name}* started reviewing the record *{record_title}*").format(curator_name=curator_name, record_title=record_title) }} | ||
|
||
{% if message %} | ||
{{ _("with the following message:")}} | ||
{{message}} | ||
{% endif %} | ||
|
||
[{{ _("Check out the curation request") }}]({{ request_link }}) | ||
|
||
{{ _("This is an auto-generated message. To manage notifications, visit your account settings")}} | ||
{%- endblock md_body %} |