From 288a57a4b1416d317c6b00c18658616a98fa65e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 20 Oct 2018 19:09:40 +0300 Subject: [PATCH] Better name & description for Trello cards. --- hc/api/transports.py | 3 ++- templates/integrations/trello_desc.html | 14 ++++++++++++++ templates/integrations/trello_name.html | 5 +++++ templates/integrations/trello_title.html | 5 ----- 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 templates/integrations/trello_desc.html create mode 100644 templates/integrations/trello_name.html delete mode 100644 templates/integrations/trello_title.html diff --git a/hc/api/transports.py b/hc/api/transports.py index 9748586e..9b10583f 100644 --- a/hc/api/transports.py +++ b/hc/api/transports.py @@ -435,7 +435,8 @@ class Trello(HttpTransport): def notify(self, check): params = { "idList": self.channel.trello_list_id, - "name": tmpl("trello_title.html", check=check), + "name": tmpl("trello_name.html", check=check), + "desc": tmpl("trello_desc.html", check=check), "key": settings.TRELLO_APP_KEY, "token": self.channel.trello_token } diff --git a/templates/integrations/trello_desc.html b/templates/integrations/trello_desc.html new file mode 100644 index 00000000..90f943b0 --- /dev/null +++ b/templates/integrations/trello_desc.html @@ -0,0 +1,14 @@ +{% load hc_extras humanize %} +{{ check.desc|safe }} + +{% if check.kind == "simple" %} +**Period:** {{ check.timeout|hc_duration }} +{% endif %} + +{% if check.kind == "cron" %} +**Schedule:** {{ check.schedule|escapejs }} +{% endif %} + +**Last Ping:** {{ check.last_ping|naturaltime }} + +[Full Details @ {% site_name %}]({{ check.details_url }}) \ No newline at end of file diff --git a/templates/integrations/trello_name.html b/templates/integrations/trello_name.html new file mode 100644 index 00000000..85583ab2 --- /dev/null +++ b/templates/integrations/trello_name.html @@ -0,0 +1,5 @@ +{% if check.status == "down" %} + Down: {{ check.name_then_code }} +{% else %} + Up: {{ check.name_then_code }} +{% endif %} diff --git a/templates/integrations/trello_title.html b/templates/integrations/trello_title.html deleted file mode 100644 index 3fcdc774..00000000 --- a/templates/integrations/trello_title.html +++ /dev/null @@ -1,5 +0,0 @@ -{% if check.status == "down" %} - {{ check.name_then_code }} is DOWN -{% else %} - {{ check.name_then_code }} is now UP -{% endif %}