Skip to content
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

fix real-time email template for the Calendar section [CPCN-632] #191

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions server/theme/email_agenda.fr_ca.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,86 @@
<h1>{{ get_highlighted_field(item, ["headline", "name"]) | safe }}</h1>
<a href="{{ url_for_agenda(item) }}"><b>Voir cet élément dans votre compte: </b>{{ url_for_agenda(item) }}<br></a>

{% if item.event %}<p class="h3"><b>Quand: </b>{{ dateString }} {{get_event_state(item)}}</p>{% endif %}
<b>Voir cet élément dans votre compte : </b><a href="{{ url_for_agenda(item) }}">{{ url_for_agenda(item) }}</a><br>

{% if item.event %}
<p class="h3"><b>Quand : </b>{{ dateString }} {{get_event_state(item)}}</p>
{% endif %}

{% if location and location != '' %}
<p class="h3"><b>Où:</b> {{ location }}</p>
<p class="h3"><b>Où : </b>{{ location }}</p>
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}

{% if map and map != '' %}
<div><img style="height: auto!important; max-width: 700px!important; width: 100%!important"
src={{ map | safe }} ></div>
src={{ map | safe }}></div>
{% endif %}

{% if contacts | length is gt 0 %}
<p><b>Contact: </b>
<p><b>Contact : </b>
{% for contact in contacts %}
<div>{{ contact.name or contact.organisation }}
{{ contact.phone }}
{{ contact.mobile }}
{{ contact.email }}</div>
{% endfor %}
</p>
</p><br>
{% endif %}

{% if links | length is gt 1 %}
<p><b>Web: </b>
<p><b>Web : </b>
{% for link in links %}
<div><a href={{ link | safe }}>{{ link }}</a><br></div>
{% endfor %}
</p>
{% endif %}

{% if item.definition_long or item.definition_short %}
<b>Description de l’événement: </b>
<b>Description de l’événement : </b>
<p>
{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}
</p>
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
{% for planning_item in item.get('planning_items', []) or [] %}
<div>
<div>
<h3>Élément de couverture:</h3>
<h3>Élément de couverture : </h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p>
<b>Description de l’élément de planification: </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}
<b>Description de l’élément de planification : </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}
</p>
{% endif %}
</div>

{% if planning_item.get('ednote') %}
<div>
<strong>Note de la rédaction:</strong>
<strong>Note de la rédaction : </strong>
{{ planning_item.get('ednote') }}
</div>
{% endif %}

{% if planning_item.get('coverages', []) %}
<p>
<div>
<p><strong>Couverture:</strong></p>
<p><strong>Couverture : </strong></p>
</div>

{% for cov in get_planning_coverages(item, planning_item._id) %}
<div>
<p><b>Type de couverture: </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Statut de couverture: </b>{{get_coverage_status(cov)}}</p>
<p><b>Date et heure d’échéance de la couverture: </b>{{get_coverage_date(cov)}}</p>
<p><b>Affecté à: </b>
<p><b>Type de couverture : </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Statut de couverture : </b>{{get_coverage_status(cov)}}</p>
<p><b>Date et heure d’échéance de la couverture : </b>{{get_coverage_date(cov)}}</p>
<p><b>Affectée à : </b>
{% if cov.get('assigned_desk_name') %}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro: {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro : {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
/
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro: {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Demande de couverture d’une utilisatrice de PC NouvellesPro : {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
</p>
</div>
{% endfor %}
</p>
{% endif %}
</div>
{% endfor %}
<div><b>Sujet enregistré: {{ topic_name }}</b></div>
<div><b>Sujet enregistré : {{ topic_name }}</b></div>
77 changes: 50 additions & 27 deletions server/theme/email_agenda.fr_ca.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,55 @@
{{ item.headline or item.name }}
Voir cet élément dans votre compte: {{ url_for_agenda(item) }}
{% if item.event %}Quand: {{ dateString }} {{get_event_state(item)}}{% endif %}
{% if location and location != '' %}Où: {{ location }}
{% endif %}{% if contacts | length is gt 0 %}Contact: {% for contact in contacts %}{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}{% if links | length is gt 1 %}Web: {% for link in links %}{{ link }}
{% endfor %}
Voir cet élément dans votre compte : {{ url_for_agenda(item) }}
{% if item.event %}
Quand : {{ dateString }} {{get_event_state(item)}}
{% endif %}
{% if item.definition_long or item.definition_short %}Description de l’événement: {{ item.definition_long or item.definition_short }}

{% if location and location != '' %}
Où : {{ location }}
{% endif %}
{% for planning_item in item.get('planning_items', []) or [] %}
Élément de couverture:
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Description de l’élément de planification: {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}
{% if planning_item.get('ednote') %}Note de la rédaction: {{ planning_item.get('ednote') }}{% endif %}
{% if planning_item.get('coverages', []) | length is gt 0 %}
Couverture:
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type de couverture: {{get_coverage_content_type(cov,recipient_language)}}
Statut de couverture: {{get_coverage_status(cov)}}
Date et heure d’échéance de la couverture: {{get_coverage_date(cov)}}
Affecté à:
{% if cov.get('assigned_desk_name')%}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}{{cov['assigned_desk_email']}}{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}{{cov['assigned_user_email']}}{% endif %}
{% endfor %}

{% if contacts | length is gt 0 %}
Contact :
{% for contact in contacts %}
{{ contact.name or contact.organisation }} {{ contact.phone }} {{ contact.mobile }} {{ contact.email }}
{% endfor %}
{% endif %}

{% if links | length is gt 1 %}
Web :
{% for link in links %}
{{ link }}
{% endfor %}
{% endif %}

{% if item.definition_long or item.definition_short %}
Description de l’événement : {{ item.definition_long or item.definition_short }}
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
Élément de couverture :
{%- if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
Description de l’élément de planification : {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
{% endif -%}

{% if planning_item.get('ednote') %}
Note de la rédaction : {{ planning_item.get('ednote') }}
{% endif %}

{% if planning_item.get('coverages', []) | length is gt 0 %}
Couverture :
{% for cov in get_planning_coverages(item, planning_item._id) %}
Type de couverture : {{ get_coverage_content_type(cov, recipient_language) }}
Statut de couverture : {{ get_coverage_status(cov) }}
Date et heure d’échéance de la couverture : {{ get_coverage_date(cov) }}
Affectée à :
{% if cov.get('assigned_desk_name') %}{{ cov['assigned_desk_name'] }}{% endif %}
{% if cov.get('assigned_desk_email') %}{{ cov['assigned_desk_email'] }}{% endif %}
/
{% if cov.get('assigned_user_name') %}{{ cov['assigned_user_name'] }}{% endif %}
{% if cov.get('assigned_user_email') %}{{ cov['assigned_user_email'] }}{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
Sujet enregistré: {{ topic_name }}

Sujet enregistré : {{ topic_name }}
75 changes: 38 additions & 37 deletions server/theme/email_agenda.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,78 @@
<h1>{{ get_highlighted_field(item, ["headline", "name"]) | safe }}</h1>
<a href="{{ url_for_agenda(item) }}"><b>View this item in your account: </b>{{ url_for_agenda(item) }} <br></a>
{% if item.event %}<p class="h3"><b>When:</b>{{ dateString }} {{get_event_state(item)}}</p>{% endif %}

<b>View this item in your account : </b><a href="{{ url_for_agenda(item) }}">{{ url_for_agenda(item) }}</a><br>

{% if item.event %}
<p class="h3"><b>When : </b>{{ dateString }} {{ get_event_state(item) }}</p>
{% endif %}

{% if location and location != '' %}
<p class="h3"><b>Where:</b> {{ location }}</p>
<p class="h3"><b>Where : </b>{{ location }}</p>
{% endif %}

{% if map and map != '' %}
<div><img style="height: auto!important; max-width: 700px!important; width: 100%!important"
src={{ map | safe }} ></div>
<div>
<img style="height: auto!important; max-width: 700px!important; width: 100%!important" src={{ map | safe }}>
</div>
{% endif %}

{% if contacts | length is gt 0 %}
<p><b>Contact: </b>
<p><b>Contact : </b>
{% for contact in contacts %}
<div>{{ contact.name or contact.organisation }}
{{ contact.phone }}
{{ contact.mobile }}
{{ contact.email }}</div>
<div>
{{ contact.name or contact.organisation }}<br>
{{ contact.phone }}<br>
{{ contact.mobile }}<br>
{{ contact.email }}
</div>
{% endfor %}
</p>
</p><br>
{% endif %}

{% if links | length is gt 1 %}
<p><b>Web: </b>
<p><b>Web : </b>
{% for link in links %}
<div><a href={{ link | safe }}>{{ link }}</a><br></div>
{% endfor %}
</p>
{% endif %}

{% if item.definition_long or item.definition_short %}
<b>Event description: </b>
<p>
{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}
</p>
<b>Event description : </b>
<p>{{ get_highlighted_field(item, ["definition_long", "definition_short"]) | safe }}</p>
{% endif %}

{% for planning_item in item.get('planning_items', []) or [] %}
{% for planning_item in item.get('planning_items', []) or [] %}
<div>
<div>
<h3>Planning item:</h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p>
<b>Planning item description:</b> {{ planning_item.get('description_text') or planning_item.get('name') or '' }}
</p>
{% endif %}
</div>
<h3>Planning item : </h3>
{% if (planning_item.get('description_text') or planning_item.get('name') or '') != (item.definition_long or item.definition_short) %}
<p><b>Planning item description : </b>{{ planning_item.get('description_text') or planning_item.get('name') or '' }}</p>
{% endif %}

{% if planning_item.get('ednote') %}
<div>
<strong>Editorial Note:</strong>
{{ planning_item.get('ednote') }}
<strong>Editorial Note : </strong>{{ planning_item.get('ednote') }}
</div>
{% endif %}

{% if planning_item.get('coverages', []) %}
<p>
<div>
<p><strong>Coverage:</strong></p>
<p><strong>Coverage : </strong></p>
</div>

{% for cov in get_planning_coverages(item, planning_item._id) %}
<div>
<p><b>Type of coverage: </b>{{get_coverage_content_type(cov,recipient_language)}}</p>
<p><b>Coverage status: </b>{{get_coverage_status(cov)}}</p>
<p><b>Coverage due date & time: </b>{{get_coverage_date(cov)}}</p>
<p><b>Type of coverage : </b>{{ get_coverage_content_type(cov, recipient_language) }}</p>
<p><b>Coverage status : </b>{{ get_coverage_status(cov) }}</p>
<p><b>Coverage due date & time : </b>{{ get_coverage_date(cov) }}</p>
{% if cov.get('assigned_desk_name') or cov.get('assigned_desk_email') or cov.get('assigned_user_name') or cov.get('assigned_user_email') %}
<p><b>Assigned to:</b>
{% if cov.get('assigned_desk_name') %}{{cov['assigned_desk_name']}}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Coverage inquiry from CP NewsPro user: {{item.headline or item.name}}">{{cov['assigned_desk_email']}}</a>{% endif %}
{% if cov.get('assigned_user_name') %}{{cov['assigned_user_name']}}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{cov['assigned_desk_email']}}?subject=Coverage inquiry from CP NewsPro user: {{item.headline or item.name}}">{{cov['assigned_user_email']}}</a>{% endif %}
<p><b>Assigned to : </b>
devketanpro marked this conversation as resolved.
Show resolved Hide resolved
{% if cov.get('assigned_desk_name') %}{{ cov['assigned_desk_name'] }}{% endif %}
{% if cov.get('assigned_desk_email') %}<a href="mailto:{{ cov['assigned_desk_email'] }}?subject=Coverage inquiry from CP NewsPro user: {{ item.headline or item.name }}">{{ cov['assigned_desk_email'] }}</a>{% endif %}
/
{% if cov.get('assigned_user_name') %}{{ cov['assigned_user_name'] }}{% endif %}
{% if cov.get('assigned_user_email') %}<a href="mailto:{{ cov['assigned_desk_email'] }}?subject=Coverage inquiry from CP NewsPro user: {{ item.headline or item.name }}">{{ cov['assigned_user_email'] }}</a>{% endif %}
</p>
{% endif %}
</div>
Expand All @@ -81,4 +82,4 @@ <h3>Planning item:</h3>
</div>
{% endfor %}

<div><b>Saved topic: {{ topic_name }}</b></div>
<div><b>Saved topic : {{ topic_name }}</b></div>
Loading
Loading