This repository has been archived by the owner on Oct 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
/
thread.html
68 lines (66 loc) · 1.78 KB
/
thread.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{% import "github.com/bakape/meguca/lang" %}
{% import "github.com/bakape/meguca/common" %}
{% import "github.com/bakape/meguca/config" %}
{% func renderThread(postHTML []byte, ln lang.Pack) %}{% stripspace %}
<span class="aside-container top-margin">
<span class="act" id="top">
<a href="#bottom">
{%s= ln.UI["bottom"] %}
</a>
</span>
<span id="expand-images" class="act">
<a>
{%s= ln.Common.Posts["expandImages"] %}
</a>
</span>
</span>
<noscript>
TODO: Noscript post creation
</noscript>
<hr>
{%z= postHTML %}
<div id="bottom-spacer"></div>
<aside class="act posting glass">
<a>
{%s= ln.UI["reply"] %}
</a>
</aside>
<hr>
<span class="aside-container">
<span class="act" id="bottom">
<a href="." class="history">
{%s= ln.UI["return"] %}
</a>
</span>
<span class="act">
<a href="#top">
{%s= ln.UI["top"] %}
</a>
</span>
<span class="act">
<a href="?last=100" class="history reload">
{%s= ln.Common.UI["last"] %}{% space %}100
</a>
</span>
<span id="lock" style="visibilty: hidden;">
{%s= ln.UI["lockedToBottom"] %}
</span>
</span>
{% endstripspace %}{% endfunc %}
ThreadPosts renders the post content of a thread. Separate function to allow
caching of generated posts.
{% func ThreadPosts(t common.Thread, json []byte, omit, imageOmit int) %}{% stripspace %}
<div id="thread-container">
{% code root := config.Get().RootURL %}
{%= renderArticle(t.Post, t.ID, omit, imageOmit, t.Subject, root) %}
{% for _, p := range t.Posts %}
{%= renderArticle(p, t.ID, 0, 0, "", root) %}
{% endfor %}
</div>
<script id="post-data" type="application/json">
{%z= json %}
</script>
<script id="board-configs" type="application/json">
{%z= config.GetBoardConfigs(t.Board).JSON %}
</script>
{% endstripspace %}{% endfunc %}