Skip to content

Commit

Permalink
reactions added to post header, tags added to meta data
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus-Tockloth committed Nov 26, 2022
1 parent 478dc28 commit f4f9000
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion topic.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Description:
Releases:
- v1.0.0 - 2022/11/21: initial release
- v1.1.0 - 2022/11/22: reply_to* added to post header
- v1.2.0 - 2022/11/25: reactions added to post header, tags added to meta data

Author:
- NN
Expand Down Expand Up @@ -44,6 +45,7 @@ Remarks:
{{/* ---------- meta data ---------- */}}
<base href="{{ $forumURL }}" />
<h2>{{ $json.meta_data.title }}</h2>
<p>{{ if $json.meta_data.tags }} {{ $json.meta_data.tags | join ", " }} {{ end }}</p>
<hr>

<table class="meta_data_table">
Expand All @@ -67,7 +69,7 @@ Remarks:
{{ $time := substr 11 16 $json.meta_data.created_at }}
<td>{{ $date }} / {{ $time }}</td>
<td>
{{ if $json.meta_data.accepted_answer }} # {{ $json.meta_data.accepted_answer.post_number }} {{ end }}
{{ if $json.meta_data.accepted_answer }} #{{ $json.meta_data.accepted_answer.post_number }} {{ end }}
</td>
<td>{{ $json.meta_data.category_id }}</td>
<td>{{ $json.meta_data.id }}</td>
Expand Down Expand Up @@ -109,6 +111,18 @@ Remarks:
/ {{ $likes }} likes
{{ end }}
{{ end }}
{{/* begin experimental */}}
{{ if .reaction_users_count }}
{{ $reactions := sub .reaction_users_count $likes }}
{{ if $reactions }}
{{ if eq (int $reactions) 1 }}
/ {{ $reactions }} react
{{ else }}
/ {{ $reactions }} reacts
{{ end }}
{{ end }}
{{ end }}
{{/* end experimental */}}
{{ if .reply_count }}
{{ if eq (int .reply_count) 1 }}
/ {{ .reply_count }} reply
Expand Down

0 comments on commit f4f9000

Please sign in to comment.