aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/templates/views/thread.html
blob: 19d81d755968ef183d358fb858d09cd57d110fe2 (plain) (blame)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{% extends "layouts/default" %}
{% import "views/macros/tags" %}
{% block content %}
<ul id="0">
    <li id="msg-{{ msg.mid }}" class="msg msgthread">
        <div class="msg-cont">
            <div class="msg-header">
                <div class="msg-avatar">
                    <a href="/{{ msg.user.name }}/"><img src="{{ msg.user.avatar }}" alt="{{ msg.user.name }}"/></a>
                </div>
                <span>
                    <a href="/{{ msg.user.name }}/"><span>{{ msg.user.name }}</span>{% if msg.user.premium %}<span style="color: green;"><i data-icon="ei-star" data-size="s"></i></span>{% endif %}</a>
                </span>
                <div class="msg-ts">
                    {% if msg.friendsOnly %}
                    <i data-icon="ei-lock" data-size="s"></i> &middot;
                    {% endif %}
                    <a href="/{{ msg.user.name }}/{{ msg.mid }}">
                        <time datetime="{{ msg.created | date('yyyy-MM-dd HH:mm:ss', timeZone="UTC") }}Z"
                              title="{{ msg.created | date('yyyy-MM-dd HH:mm:ss', timeZone="UTC") }} GMT">
                            {{ msg.created | prettyTime }}
                        </time>
                    </a>
                    {% if msg.updatedAt != msg.created %}
                    &middot; Edited
                    {% endif %}
                </div>
            </div>
            <div class="msg-txt">
                <span class="msg-tags">
                    {{ tags(msg.user.name, msg.tags | tagsList) }}
                </span>
                {{ msg | formatMessage }}
            </div>
            {% if msg.AttachmentType is not empty %}
            <div class="msg-media">
                <a href="//i.juick.com/p/{{ msg.mid }}.{{ msg.AttachmentType }}" data-fname="{{ msg.mid }}.{{ msg.AttachmentType }}">
                    <img src="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" alt=""/>
                </a>
            </div>
            {% endif %}
            <nav class="l">
                {% if visitor.uid == msg.user.uid and (msg.user.premium or msg.user.admin) %}
                <a href="/{{ msg.mid }}" class="a-privacy msg-button">
                    <span class="msg-button-icon">
                        {% if msg.friendsOnly %}
                        <i data-icon="ei-unlock" data-size="s"></i>
                        <span>&nbsp;{{ i18n("messages","message.unlock") }}</span>
                        {% else %}
                        <i data-icon="ei-lock" data-size="s"></i>
                        <span>&nbsp;{{ i18n("messages","message.lock") }}</span>
                        {% endif %}
                    </span>
                </a>
                {% elseif visitor.uid > 0 %}
                <a href="/post?body=!+%23{{ msg.mid }}" class="a-like msg-button">
                    <span class="msg-button-icon">
                        <i data-icon="ei-heart" data-size="s"></i>
                        {% if msg.recommendations.size() > 0 %}&nbsp;{{ msg.recommendations.size() }}
                        {% else %}
                        <span>&nbsp;{{ i18n("messages","message.recommend") }}</span>
                        {% endif %}
                    </span>
                </a>
                {% else %}
                <a href="/login?retpath={{ retpath | default('/') }}" class="a-login msg-button">
                    <span class="msg-button-icon">
                        <i data-icon="ei-heart" data-size="s"></i>
                        {% if msg.recommendations.size() > 0 %}&nbsp;{{ msg.recommendations.size() }}
                        {%else %}
                        <span>&nbsp;{{ i18n("messages","message.recommend") }}</span>
                        {% endif %}
                    </span>
                </a>
                {% endif %}
                {% if visitor.uid > 0 %}
                {% if visitor.uid != msg.user.uid %}
                {% if msg.subscribed %}
                <a href="/post?body=U+%23{{ msg.mid }}" class="msg-button">
                    <i data-icon="ei-check" data-size="s"></i>
                    <span>&nbsp;{{ i18n("messages","message.subscribed") }}</span>
                </a>
                {% else %}
                <a href="/post?body=S+%23{{ msg.mid }}" class="a-sub msg-button">
                    <i data-icon="ei-eye" data-size="s"></i>
                    <span>&nbsp;{{ i18n("messages","message.subscribe") }}</span>
                </a>
                {% endif %}
                {% else %}
                <a href="/post?body=D+%23{{ msg.mid }}" class="msg-button">
                    <i data-icon="ei-close" data-size="s"></i>
                    <span>&nbsp;{{ i18n("messages","message.delete") }}</span>
                </a>
                {% endif %}
                {% endif %}
            </nav>
            {% if msg.VisitorCanComment %}
            <form class="msg-comment-target">
                <input type="hidden" name="mid" value="{{ msg.mid }}"/>
                <div class="msg-comment">
                    <div class="ta-wrapper">
                        <textarea name="body" rows="1" class="reply" placeholder="{{ i18n("messages","message.writeComment") }}"></textarea>
                    </div>
                </div>
            </form>
            {% endif %}
            {% if msg.recommendations.size() > 0 %}
            <div class="msg-recomms">{{ i18n("messages","message.recommendedBy") }}
                {% for rec in msg.recommendations %}
                {% if rec.uri.toString() is empty %}
                    <a href="/{{ rec.name }}/">@{{ rec.name }}</a>{% if loop.index < (loop.length - 1) %}, {% endif %}
                {% else %}
                    <a href="{{ rec.uri }}" data-user-uri="1">@{{ rec.name }}</a>{% if loop.index < (loop.length - 1) %}, {% endif %}
                {% endif %}
                {% endfor %}
            </div>
            {% endif %}
        </div>
    </li>
</ul>
<div class="title2">
    {% if visitor.uid > 0 %}
    <img src="/api/thread/mark_read/{{ msg.mid }}-{{ msg.rid }}.gif?hash={{visitor.authHash}}" />
    {% endif %}
    <h2>{{ i18n("messages","reply.replies") }} ({{ replies.size() }})</h2>
</div>

<ul id="replies">
    {% for msg in replies %}
    <li id="{{ msg.rid }}" class="msg">
        <div class="msg-cont">
            <div class="msg-header" data-uri="{{ msg.user.uri }}">
                {% if not msg.user.banned %}
                <a class="a-username" href="/{{ msg.user.name }}/">{{ msg.user.name }}{% if msg.user.premium %}<span style="color: green;"><i data-icon="ei-star" data-size="s"></i></span>{% endif %}</a>
                <div class="msg-avatar">
                    <a class="a-username" href="/{{ msg.user.name }}/">
                        <img src="{{ msg.user.avatar }}" alt="{{ msg.user.name }}"/>
                    </a>
                </div>
                {% else %}
                [удалено]:
                <div class="msg-avatar">
                    <img src="//i.juick.com/av-96.png"/>
                </div>
                {% endif %}
                <div class="msg-ts">
                    <a href="/{{ msg.mid }}#{{ msg.rid }}">
                        <time datetime="{{ msg.created | date('yyyy-MM-dd HH:mm:ss', timeZone="UTC") }}Z"
                              title="{{ msg.created | date('yyyy-MM-dd HH:mm:ss', timeZone="UTC") }} GMT">
                            {{ msg.created | prettyTime }}
                        </time>
                    </a>
                    {% if msg.updatedAt != msg.created %}
                    &middot; Edited
                    {% endif %}
                </div>
            </div>
            <div class="msg-txt">{{ msg | formatMessage }}</div>
            {% if msg.AttachmentType is not empty %}
            <div class="msg-media">
                <a href="//i.juick.com/p/{{ msg.mid }}-{{ msg.rid }}.{{ msg.AttachmentType }}" data-fname="{{ msg.mid }}-{{ msg.rid }}.{{ msg.AttachmentType }}">
                    <img src="//i.juick.com/photos-512/{{ msg.mid }}-{{ msg.rid }}.{{ msg.AttachmentType }}" alt=""/>
                </a>
            </div>
            {% endif %}
            <div class="msg-links">/{{ msg.rid }}
                {% if msg.replyto > 0 %}
                {{ i18n("messages","reply.inReplyTo") }} <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a>
                {% endif %}
                {% if msg.VisitorCanComment %}
                &middot; <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">{{ i18n("messages","reply.reply") }}</a>
            </div>
            <div class="msg-comment-target msg-comment-hidden"></div>
            {% elseif visitor.uid == 0 %}
            &middot; <a href="#" class="a-login">{{ i18n("messages","reply.reply") }}</a>
        </div>
        {% else %}
        </div>
        {% endif %}
        </div>
    </li>
    {% endfor %}
</ul>
{% endblock %}
{% block "column" %}
{% include "views/partial/usercolumn" %}
{% endblock %}