summaryrefslogtreecommitdiff
path: root/client/html/post_main.tpl
blob: f0fc46d70653daf508b2640f7ece3ba2d37dd9c4 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<div class='content-wrapper transparent-container post-view'>
    <aside class='sidebar'>
        <nav class='buttons'>
            <article class='previous-post'>
                <% if (ctx.prevPostId) { %>
                    <% if (ctx.editMode) { %>
                        <a rel='prev' href='<%= ctx.getPostEditUrl(ctx.prevPostId, ctx.parameters) %>'>
                    <% } else { %>
                        <a rel='prev' href='<%= ctx.getPostUrl(ctx.prevPostId, ctx.parameters) %>'>
                    <% } %>
                <% } else { %>
                    <a rel='prev' class='inactive'>
                <% } %>
                    <i class='fa fa-chevron-left'></i>
                    <span class='vim-nav-hint'>&lt; Previous post</span>
                </a>
            </article>
            <article class='next-post'>
                <% if (ctx.nextPostId) { %>
                    <% if (ctx.editMode) { %>
                        <a rel='next' href='<%= ctx.getPostEditUrl(ctx.nextPostId, ctx.parameters) %>'>
                    <% } else { %>
                        <a rel='next' href='<%= ctx.getPostUrl(ctx.nextPostId, ctx.parameters) %>'>
                    <% } %>
                <% } else { %>
                    <a rel='next' class='inactive'>
                <% } %>
                    <i class='fa fa-chevron-right'></i>
                    <span class='vim-nav-hint'>Next post &gt;</span>
                </a>
            </article>
            <article class='random-post'>
                <% if (ctx.randomPostId) { %>
                    <% if (ctx.editMode) { %>
                        <a rel='next' href='<%= ctx.getPostEditUrl(ctx.randomPostId, {
                            query: ctx.parameters.query,
                            metrics: ctx.parameters.metrics,
                            cachenumber: Math.round(Math.random() * 1000)}) %>'>
                    <% } else { %>
                        <a rel='next' href='<%= ctx.getPostUrl(ctx.randomPostId, {
                            query: ctx.parameters.query,
                            metrics: ctx.parameters.metrics,
                            cachenumber: Math.round(Math.random() * 1000)}) %>'>
                    <% } %>
                <% } else { %>
                    <a rel='next' class='inactive'>
                <% } %>
                    <i class='fa fa-random'></i>
                    <span class='vim-nav-hint'>Random post</span>
                </a>
            </article>
            <article class='edit-post'>
                <% if (ctx.editMode) { %>
                    <a href='<%= ctx.getPostUrl(ctx.post.id, ctx.parameters) %>'>
                        <i class='fa fa-reply'></i>
                        <span class='vim-nav-hint'>Back to view mode</span>
                    </a>
                <% } else { %>
                    <% if (ctx.canEditPosts || ctx.canDeletePosts || ctx.canFeaturePosts) { %>
                        <a href='<%= ctx.getPostEditUrl(ctx.post.id, ctx.parameters) %>'>
                    <% } else { %>
                        <a class='inactive'>
                    <% } %>
                        <i class='fa fa-pencil-alt'></i>
                        <span class='vim-nav-hint'>Edit post</span>
                    </a>
                <% } %>
            </article>
        </nav>

        <div class='sidebar-container'></div>

        <% if (window.innerWidth <= 800) { %>
            <div class='comments-panel'>
                <% if (ctx.canListComments) { %>
                    <div class='comments-container'></div>
                <% } %>
                <% if (ctx.canCreateComments) { %>
                    <a id='add-comment-button'><h3>Add comment</h3></a>
                    <div class='comment-form-container'></div>
                <% } %>
            </div>
        <% } %>
    </aside>

    <div class='content'>
        <div class='post-container'></div>

        <% if (window.innerWidth > 800) { %>
            <% if (ctx.canListComments) { %>
                <div class='comments-container'></div>
            <% } %>

            <% if (ctx.canCreateComments) { %>
                <a id='add-comment-button'><h3>Add comment</h3></a>
                <div class='comment-form-container'></div>
            <% } %>
        <% } %>
    </div>
</div>