]>
Commit | Line | Data |
---|---|---|
a7cf03c1 | 1 | <script lang="ts"> |
58f7d521 | 2 | export let topic; |
74b03c33 | 3 | |
58f7d521 | 4 | import { _ } from 'svelte-i18n'; |
a7cf03c1 RBR |
5 | import Post from '$lib/components/post/post.svelte'; |
6 | import { readableTime } from '$lib/utils/readable_time'; | |
bd8e98d7 | 7 | |
8ae7249a | 8 | $: remainingTime = topic.updated_at + topic.ttl - Date.now(); |
58f7d521 | 9 | $: remaining = readableTime(remainingTime); |
74b03c33 | 10 | </script> |
66dc4cae | 11 | |
58f7d521 RBR |
12 | <div class="h-entry" title={$_('topic.title')}> |
13 | <h1 class="p-name">{topic.title}</h1> | |
14 | <aside class="topic-meta" title={$_('topic.metadata_title')}> | |
15 | {#if topic.forum} | |
47b0bfe4 | 16 | <span class="topic-location"> |
cac85db0 | 17 | {$_('topic.category_location')} |
47b0bfe4 | 18 | <a href="/f/{topic.forum.id}" class="p-category"> |
cac85db0 RBR |
19 | {topic.forum.glyph} |
20 | {$_(topic.forum.label)} | |
21 | </a>. | |
22 | </span> | |
58f7d521 | 23 | {/if} |
47b0bfe4 | 24 | <span class="topic-ttl"> |
cac85db0 RBR |
25 | <a class="u-url u-uid" title={$_('topic.permalink_title')} href="/t/{topic.id}"> |
26 | ({$_('topic.remaining_time', { | |
58f7d521 | 27 | values: { remaining: $_(remaining.label, { values: { count: remaining.count } }) } |
cac85db0 RBR |
28 | })}) |
29 | </a>. | |
30 | </span> | |
58f7d521 RBR |
31 | </aside> |
32 | {#if topic.tags.length > 0} | |
33 | <aside class="topic-tags" title={$_('topic.tags_title')}> | |
34 | {$_('topic.tags_location')} | |
35 | {#each topic.tags as tag} | |
47b0bfe4 | 36 | <a href="/g/{tag.id}" class="p-category"> |
cac85db0 RBR |
37 | {tag.id}<span class="tag-weight">({tag.weight})</span> |
38 | </a>{' '} | |
58f7d521 RBR |
39 | {/each} |
40 | </aside> | |
41 | {/if} | |
42 | {#each topic.posts as post, index} | |
43 | <Post {post} {index} count={topic.posts.length} /> | |
44 | {/each} | |
45 | </div> |