Skip to content

Commit

Permalink
[#2638] Update scheduled email list and detail templates, make relate…
Browse files Browse the repository at this point in the history
…d object more prominent
  • Loading branch information
pbanaszkiewicz committed Apr 18, 2024
1 parent da7d388 commit 7d87b1b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
32 changes: 16 additions & 16 deletions amy/templates/emails/scheduled_email_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,26 @@ <h1>
{% endif %}

<table class="table table-striped">
<tr>
<th>Email template:</th>
<td colspan="2"><a href="{{ scheduled_email.template.get_absolute_url }}">{{ scheduled_email.template }}</a></td>
</tr>
<tr>
<th width="20%">ID:</th>
<td colspan="2">{{ scheduled_email.id }}</td>
</tr>
<tr>
<th>Related object:</th>
<td colspan="2">
{% if scheduled_email.generic_relation and scheduled_email.generic_relation.get_absolute_url %}
<a href="{{ scheduled_email.generic_relation.get_absolute_url }}">{{ scheduled_email.generic_relation }}</a>
{% elif scheduled_email.generic_relation %}
{{ scheduled_email.generic_relation }}
{% else %}
&mdash;
{% endif %}
</td>
</tr>
<tr>
<th>State:</th>
<td colspan="2">
Expand Down Expand Up @@ -140,22 +156,6 @@ <h1>
{{ rendered_body|safe }}
</td>
</tr>
<tr>
<th>Email template:</th>
<td colspan="2"><a href="{{ scheduled_email.template.get_absolute_url }}">{{ scheduled_email.template }}</a></td>
</tr>
<tr>
<th>Related object:</th>
<td colspan="2">
{% if scheduled_email.generic_relation and scheduled_email.generic_relation.get_absolute_url %}
<a href="{{ scheduled_email.generic_relation.get_absolute_url }}">{{ scheduled_email.generic_relation }}</a>
{% elif scheduled_email.generic_relation %}
{{ scheduled_email.generic_relation }}
{% else %}
&mdash;
{% endif %}
</td>
</tr>
</table>

<table class="table table-striped">
Expand Down
18 changes: 14 additions & 4 deletions amy/templates/emails/scheduled_email_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@
{% if scheduled_emails %}
<table class="table table-striped">
<tr>
<th>ID</th>
<th>Name</th>
<th>State</th>
<th>Scheduled at</th>
<th>Related object</th>
<th>To</th>
<th>From</th>
<th>Subject</th>
<th>Template</th>
</tr>
{% for email in scheduled_emails %}
<tr>
<td><a href="{{ email.get_absolute_url }}">{{ email.id }}</a></td>
<td>
<a href="{{ email.get_absolute_url }}">{{ email.template.name }}</a>
</td>
<td class="text-{% if email.state == 'failed' %}danger{% elif email.state == 'succeeded'%}success{% elif email.state == 'cancelled' %}secondary{% else %}info{% endif %}">{{ email.state }}</td>
<td>{{ email.scheduled_at }}</td>
<td>
{% if email.generic_relation and email.generic_relation.get_absolute_url %}
<a href="{{ email.generic_relation.get_absolute_url }}">{{ email.generic_relation }}</a>
{% elif email.generic_relation %}
{{ email.generic_relation }}
{% else %}
&mdash;
{% endif %}
</td>
<td>
{% if email.to_header %}
<ul>
Expand All @@ -33,7 +44,6 @@
</td>
<td>{{ email.from_header }}</td>
<td>{{ email.subject }}</td>
<td><a href="{{ email.template.get_absolute_url }}">{{ email.template.name }}</a></td>
</tr>
{% endfor %}
</table>
Expand Down

0 comments on commit 7d87b1b

Please sign in to comment.