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.
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: 59
diff changeset
     1
- Status ID: {{color "red"}}{{printf "%.0f" .id}}{{color "reset"}}  {{color "magenta"}}@{{.account.acct}}{{color "reset"}}
52
2ffe0d622db9 Use the color function in the ANSI templates
Mikael Berthe <mikael@lilotux.net>
parents: 23
diff changeset
     2
  Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
23
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     3
  Date: {{.created_at}}
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     4
  URL: {{.url}}
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     5
{{- if gt .in_reply_to_id 0.0}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
     6
  Replying to: {{printf "%.0f" .in_reply_to_id}}{{end}}
23
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     7
{{- with .spoiler_text}}
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     8
  Spoiler: {{.}}{{end}}
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     9
{{- if .reblog }}{{with .reblog}}
52
2ffe0d622db9 Use the color function in the ANSI templates
Mikael Berthe <mikael@lilotux.net>
parents: 23
diff changeset
    10
  {{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: 59
diff changeset
    11
    ID: {{printf "%.0f" .id}}
52
2ffe0d622db9 Use the color function in the ANSI templates
Mikael Berthe <mikael@lilotux.net>
parents: 23
diff changeset
    12
    Name: {{color ",,bold"}}{{.account.display_name}}{{color "reset"}}
23
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    13
    Date: {{.created_at}}
52
2ffe0d622db9 Use the color function in the ANSI templates
Mikael Berthe <mikael@lilotux.net>
parents: 23
diff changeset
    14
    Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}
59
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    15
{{- range .media_attachments}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    16
    - Attachment ID: {{printf "%.0f" .id}}
59
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    17
{{- if .text_url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    18
      Text URL: {{.text_url}}{{else if .url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    19
      URL: {{.url}}{{else if .remote_url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    20
      Remote URL: {{.remote_url}}{{end}}{{end}}
23
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
{{end}}{{else}}
52
2ffe0d622db9 Use the color function in the ANSI templates
Mikael Berthe <mikael@lilotux.net>
parents: 23
diff changeset
    22
  Message: {{color "blue"}}{{.content | fromhtml}}{{color "reset"}}
59
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    23
{{- range .media_attachments}}
76
f155f9d86832 Fix in_reply_to ID format in templates
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    24
  - Attachment ID: {{printf "%.0f" .id}}
59
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    25
{{- if .text_url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    26
    Text URL: {{.text_url}}{{else if .url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    27
    URL: {{.url}}{{else if .remote_url}}
ff88978ceb55 Update templates
Mikael Berthe <mikael@lilotux.net>
parents: 52
diff changeset
    28
    Remote URL: {{.remote_url}}{{end}}{{end}}
23
2ba1ea451669 Add template samples
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
{{end -}}