Skip to content
Snippets Groups Projects
Commit 63b166ab authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch '27-review-and-fix-translation-of-mail-templates' into 'master'

Resolve "Review and fix translation of mail templates"

Closes #27

See merge request !33
parents 31500a05 73b2d224
No related branches found
No related tags found
1 merge request!33Resolve "Review and fix translation of mail templates"
Pipeline #2907 passed
{% load i18n %}
{% block subject %}
{% blocktrans with question=question|truncatewords:5 %}New question: {{ question }}{% endblocktrans %}
{% endblock %}
{% block plain %}
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <{{ email }}>) has asked the following question:
{% endblocktrans %}
{{ question }}
{% endblock %}
{% block html %}
<style>
{% include "templated_email/html_mail.css" %}
</style>
<main>
<p>
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <a href="mailto:{{ email }}">&lt;{{ email }}&gt;</a>)
has asked the following question:
{% endblocktrans %}
</p>
<div class="card-panel">
<h4>{{ question }}</h4>
</div>
</main>
{% endblock %}
{% load i18n %}
{% block subject %}
{% blocktrans with user=user.person.full_name %}New feedback from {{ user }}{% endblocktrans %}
{% endblock %}
{% block plain %}
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <{{ email }}>) has given the following feedback:
Design rating: {{ design_rating }} out of 5 stars.
Performance rating: {{ performance_rating }} out of 5 stars.
Usability rating: {{ usability_rating }} out of 5 stars.
Overall rating: {{ overall_rating }} out of 5 stars.
What do you like? What would you change?
{{ apps }}
What else do you want to tell us?
{{ more }}
What do you think should be added to AlekSIS?
{{ ideas }}
{% endblocktrans %}
{% endblock %}
{% block html %}
<style>
{% include "templated_email/html_mail.css" %}
</style>
<main>
<p>
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <a href="mailto:{{ email }}">&lt;{{ email }}&gt;</a>)
has given the following feedback:
{% endblocktrans %}
</p>
<div class="card-panel">
<table>
<tr>
<th>{% trans "Design rating" %}</th>
<td class="stars">
{% for _ in " "|center:design_rating %}★{% endfor %}
{% with rating="-"|add:design_rating %}
{% with count=5|add:rating %}
{% for _ in " "|center:count %}☆{% endfor %}
{% endwith %}
{% endwith %}
</td>
</tr>
<tr>
<th>{% trans "Performance rating" %}</th>
<td class="stars">
{% for _ in " "|center:performance_rating %}★{% endfor %}
{% with rating="-"|add:performance_rating %}
{% with count=5|add:rating %}
{% for _ in " "|center:count %}☆{% endfor %}
{% endwith %}
{% endwith %}
</td>
</tr>
<tr>
<th>{% trans "Usability rating" %}</th>
<td class="stars">
{% for _ in " "|center:usability_rating %}★{% endfor %}
{% with rating="-"|add:usability_rating %}
{% with count=5|add:rating %}
{% for _ in " "|center:count %}☆{% endfor %}
{% endwith %}
{% endwith %}
</td>
</tr>
<tr>
<th>{% trans "Overall rating" %}</th>
<td class="stars">
{% for _ in " "|center:overall_rating %}★{% endfor %}
{% with rating="-"|add:overall_rating %}
{% with count=5|add:rating %}
{% for _ in " "|center:count %}☆{% endfor %}
{% endwith %}
{% endwith %}
</td>
</tr>
<tr>
<th>{% trans "What do you like? What would you change?" %}</th>
<td>{{ apps }}</td>
</tr>
<tr>
<th>{% trans "What else do you want to tell us?" %}</th>
<td>{{ ideas }}</td>
</tr>
<tr>
<th>{% trans "What do you think should be added to AlekSIS?" %}</th>
<td>{{ more }}</td>
</tr>
</table>
</div>
</main>
{% endblock %}
{% load i18n %}
{% block subject %} {% trans "New" %} {{ type }} {% trans "from" %} {{ user.person.mail_sender_via }} {% endblock %}
{% block plain %}
{% trans "The user" %} {{ user.username }} ({% trans "full name: " %} {{ user.first_name }} {{ user.last_name }}, {% trans "e-mail: " %} {{ user.email }}) {% trans "has submitted the following" %} {{ type }}:
{% for item in description %}
{{ item }}
{% endfor %}
{% endblock %}
{% block html %}
<main>
<p>{% trans "The user" %} {{ user.username }} ({% trans "full name: " %} {{ user.first_name }} {{ user.last_name }}, {% trans "e-mail: " %} {{ user.email }}) {% trans "has submitted the following" %} {{ type }}: </p>
<blockquote>
{% for item in description %}
<p>{{ item }}</p>
{% endfor %}
</blockquote>
</main>
{% endblock %}
body {
line-height: 1.5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-weight: normal;
color: rgba(0, 0, 0, 0.87);
}
span.chip {
display: inline-block;
height: 32px;
font-size: 13px;
font-weight: 500;
color: rgba(0,0,0,0.6);
line-height: 32px;
padding: 0 12px;
border-radius: 16px;
background-color: #e4e4e4;
margin-bottom: 5px;
margin-right: 5px;
}
.card-panel {
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2);
-webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2);
-webkit-transition: -webkit-box-shadow .25s;
transition: -webkit-box-shadow .25s;
transition: box-shadow .25s;
transition: box-shadow .25s, -webkit-box-shadow .25s;
padding: 24px;
margin: .5rem 0 1rem 0;
border-radius: 2px;
background-color: #fff;
}
table tr>th {
text-align: left;
}
td.stars {
color: #fe9e27;
font-size: 20px;
}
{% load i18n %}
{% block subject %}
{% blocktrans with issue=short_description %}New issue: {{ issue }}{% endblocktrans %}
{% endblock %}
{% block plain %}
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <{{ email }}>) has submitted the following issue:
{% endblocktrans %}
{{ categories }}
{{ short_description }}
{{ long_description }}
{% endblock %}
{% block html %}
<style>
{% include "templated_email/html_mail.css" %}
</style>
<main>
<p>
{% blocktrans with username=user.username full_name=user.person.full_name email=user.person.email %}
The user {{ username }} (full name: {{ full_name }}, email: <a href="mailto:{{ email }}">&lt;{{ email }}&gt;</a>)
has submitted the following issue:
{% endblocktrans %}
</p>
<div class="card-panel">
<p>
{% for category in categories_single %}
<span class="chip">{{ category }}</span>
{% if not forloop.last %}
{% endif %}
{% endfor %}
</p>
<h4>{{ short_description }}</h4>
<p>{{ long_description|linebreaksbr }}</p>
</div>
</main>
{% endblock %}
...@@ -39,13 +39,12 @@ def ask_faq(request): ...@@ -39,13 +39,12 @@ def ask_faq(request):
act.save() act.save()
context = { context = {
"description": [question], "question": question,
"user": request.user, "user": request.user,
"type": _("FAQ question"),
} }
send_templated_mail( send_templated_mail(
template_name="hjelp", template_name="faq",
from_email=request.user.person.mail_sender_via, from_email=request.user.person.mail_sender_via,
headers={ headers={
"Reply-To": request.user.person.mail_sender, "Reply-To": request.user.person.mail_sender,
...@@ -105,16 +104,16 @@ def report_issue(request): ...@@ -105,16 +104,16 @@ def report_issue(request):
# Send mail # Send mail
context = { context = {
"description": [ "categories": add_arrows([category_1, category_2, category_3, free_text, ]),
add_arrows([category_1, category_2, category_3, free_text,]), "categories_single":
short_description, (element for element in [category_1, category_2, category_3, free_text, ]
long_description, if element and element != "None"),
], "short_description": short_description,
"long_description": long_description,
"user": request.user, "user": request.user,
"type": _("Issue"),
} }
send_templated_mail( send_templated_mail(
template_name="hjelp", template_name="rebus",
from_email=request.user.person.mail_sender_via, from_email=request.user.person.mail_sender_via,
headers={ headers={
"Reply-To": request.user.person.mail_sender, "Reply-To": request.user.person.mail_sender,
...@@ -159,20 +158,17 @@ def feedback(request): ...@@ -159,20 +158,17 @@ def feedback(request):
# Send mail # Send mail
context = { context = {
"description": [ "design_rating": design_rating,
_(f"Design rating: {design_rating} out of 5 stars."), "performance_rating": performance_rating,
_(f"Performance rating: {performance_rating} out of 5 stars."), "usability_rating": usability_rating,
_(f"Usability rating: {usability_rating} out of 5 stars."), "overall_rating": overall_rating,
_(f"Overall rating: {overall_rating} out of 5 stars."), "more": more,
more, "apps": apps,
apps, "ideas": ideas,
ideas,
],
"user": request.user, "user": request.user,
"type": _("Feedback"),
} }
send_templated_mail( send_templated_mail(
template_name="hjelp", template_name="feedback",
from_email=request.user.person.mail_sender_via, from_email=request.user.person.mail_sender_via,
headers={ headers={
"Reply-To": request.user.person.mail_sender, "Reply-To": request.user.person.mail_sender,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment