Skip to content
Snippets Groups Projects
Commit df092754 authored by Julian's avatar Julian
Browse files

Update feedback emails

parent 7bda3bd0
No related branches found
No related tags found
1 merge request!33Resolve "Review and fix translation of mail templates"
Pipeline #2874 passed
{% 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 }}, e-mail: <{{ 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 }}, e-mail: <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 %}
...@@ -31,3 +31,11 @@ span.chip { ...@@ -31,3 +31,11 @@ span.chip {
border-radius: 2px; border-radius: 2px;
background-color: #eaeaea; background-color: #eaeaea;
} }
table tr>th {
text-align: left;
}
td.stars {
color: #fe9e27;
font-size: 20px;
}
...@@ -158,20 +158,17 @@ def feedback(request): ...@@ -158,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