templates/ansi-notification.tmpl
author Mikael Berthe <mikael@lilotux.net>
Sat, 06 May 2017 19:52:39 +0200
changeset 76 f155f9d86832
parent 61 e29fec86e0c9
child 78 b40bc3a8b572
permissions -rw-r--r--
Fix in_reply_to ID format in templates The default format for numbers in templates is double, so we have to explicitly set the format string. BTW, replace ".var | printf FMT" with "printf FMT .var"... It is slightly more readable.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
     1
- Notification ID: {{color "red"}}{{printf "%.0f" .id}}{{color "reset"}}
60
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
  Type: {{color ",,bold"}}{{.type}}{{color "reset"}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
  Timestamp: {{.created_at}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
{{- with .url}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
      URL: {{.url}}{{end}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     6
{{- with .account}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
     7
  - Account: ({{printf "%.0f" .id}}) {{color "magenta"}}@{{.acct}}{{color "reset"}}{{if .display_name}} - {{color "white,,bold"}}{{.display_name}}{{color "reset"}}{{end}}{{end}}
60
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
{{- with .status}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
     9
  - Status ID: {{color "red"}}{{printf "%.0f" .id}}{{color "reset"}}  {{color "magenta"}}@{{.account.acct}}{{color "reset"}}
60
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    10
    Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    11
    Date: {{.created_at}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    12
    URL: {{.url}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
{{- if gt .in_reply_to_id 0.0}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    14
    Replying to: {{.in_reply_to_id}}{{end}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
{{- with .spoiler_text}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
    Spoiler: {{.}}{{end}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
{{- if .reblog }}{{with .reblog}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
    {{color ",,bold"}}Reblogged from: {{color "magenta"}}@{{.account.acct}}{{color "reset"}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
    19
      ID: {{printf "%.0f" .id}}
60
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
      Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
      Date: {{.created_at}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
      Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}{{end}}{{else}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
    Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
{{- range .media_attachments}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
    25
    - Attachment ID: {{printf "%.0f" .id}}
60
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
{{- if .text_url}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
      Text URL: {{.text_url}}{{else if .url}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
      URL: {{.url}}{{else if .remote_url}}
1ca78111de77 Add template for notifications
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
      Remote URL: {{.remote_url}}{{end}}{{end}}{{end}}{{end}}