templates/ansi-status.tmpl
author Mikael Berthe <mikael@lilotux.net>
Sat, 06 May 2017 19:52:39 +0200
changeset 76 f155f9d86832
parent 59 ff88978ceb55
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.

- Status ID: {{color "red"}}{{printf "%.0f" .id}}{{color "reset"}}  {{color "magenta"}}@{{.account.acct}}{{color "reset"}}
  Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
  Date: {{.created_at}}
  URL: {{.url}}
{{- if gt .in_reply_to_id 0.0}}
  Replying to: {{printf "%.0f" .in_reply_to_id}}{{end}}
{{- with .spoiler_text}}
  Spoiler: {{.}}{{end}}
{{- if .reblog }}{{with .reblog}}
  {{color ",,bold"}}Reblogged from: {{color "magenta"}}@{{.account.acct}}{{color "reset"}}
    ID: {{printf "%.0f" .id}}
    Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
    Date: {{.created_at}}
    Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}
{{- range .media_attachments}}
    - Attachment ID: {{printf "%.0f" .id}}
{{- if .text_url}}
      Text URL: {{.text_url}}{{else if .url}}
      URL: {{.url}}{{else if .remote_url}}
      Remote URL: {{.remote_url}}{{end}}{{end}}
{{end}}{{else}}
  Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}
{{- range .media_attachments}}
  - Attachment ID: {{printf "%.0f" .id}}
{{- if .text_url}}
    Text URL: {{.text_url}}{{else if .url}}
    URL: {{.url}}{{else if .remote_url}}
    Remote URL: {{.remote_url}}{{end}}{{end}}
{{end -}}