"Details..." instead of "Show Log..." in emails.

This commit is contained in:
Pēteris Caune 2018-08-20 19:30:36 +03:00
parent 1b664a6b54
commit 78aca869c5
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
4 changed files with 18 additions and 5 deletions

View File

@ -85,8 +85,8 @@ class Check(models.Model):
def url(self): def url(self):
return settings.PING_ENDPOINT + str(self.code) return settings.PING_ENDPOINT + str(self.code)
def log_url(self): def details_url(self):
return settings.SITE_ROOT + reverse("hc-log", args=[self.code]) return settings.SITE_ROOT + reverse("hc-details", args=[self.code])
def email(self): def email(self):
return "%s@%s" % (self.code, settings.PING_EMAIL_DOMAIN) return "%s@%s" % (self.code, settings.PING_EMAIL_DOMAIN)

View File

@ -17,6 +17,19 @@ Here is a summary of your checks:
Thanks,<br> Thanks,<br>
The {% escaped_site_name %} Team The {% escaped_site_name %} Team
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"url": "{{ check.details_url }}",
"name": "View in {% site_name%}"
},
"description": "View in {% site_name%}"
}
</script>
{% endblock %} {% endblock %}
{% block unsub %} {% block unsub %}

View File

@ -59,11 +59,11 @@
<td class="mobile-hide" style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;"> <td class="mobile-hide" style="border-top: 1px solid #EDEFF2; padding: 16px 8px; font-family: Helvetica, Arial, sans-serif;">
{% if check.last_ping %} {% if check.last_ping %}
{{ check.last_ping|naturaltime }} {{ check.last_ping|naturaltime }}
<br />
<a class="view-log" href="{{ check.log_url }}">Show Log…</a>
{% else %} {% else %}
Never Never
{% endif %} {% endif %}
<br />
<a class="view-log" href="{{ check.details_url }}">Details…</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -2,7 +2,7 @@
{% if check.status == "down" %} {% if check.status == "down" %}
{{ check.name_then_code }} is down. {{ check.name_then_code }} is down.
Last ping was {{ check.last_ping|naturaltime }}. Last ping was {{ check.last_ping|naturaltime }}.
Log: {{ check.log_url }} Details: {{ check.details_url }}
{% else %} {% else %}
{{ check.name_then_code }} received a ping and is now UP {{ check.name_then_code }} received a ping and is now UP
{% endif %} {% endif %}