Browse Source

Better name & description for Trello cards.

pull/195/head
Pēteris Caune 6 years ago
parent
commit
288a57a4b1
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 21 additions and 6 deletions
  1. +2
    -1
      hc/api/transports.py
  2. +14
    -0
      templates/integrations/trello_desc.html
  3. +5
    -0
      templates/integrations/trello_name.html
  4. +0
    -5
      templates/integrations/trello_title.html

+ 2
- 1
hc/api/transports.py View File

@ -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
}


+ 14
- 0
templates/integrations/trello_desc.html View File

@ -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 }})

+ 5
- 0
templates/integrations/trello_name.html View File

@ -0,0 +1,5 @@
{% if check.status == "down" %}
Down: {{ check.name_then_code }}
{% else %}
Up: {{ check.name_then_code }}
{% endif %}

+ 0
- 5
templates/integrations/trello_title.html View File

@ -1,5 +0,0 @@
{% if check.status == "down" %}
{{ check.name_then_code }} is DOWN
{% else %}
{{ check.name_then_code }} is now UP
{% endif %}

Loading…
Cancel
Save