summaryrefslogtreecommitdiffstats
path: root/_includes/commentsthread.html
blob: 2e1119a4a422a9c53990a970a81de190fdce15e8 (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
{% comment %}
	argv: id_of_object_whose_posts_you_want,__isinathread
	return: next UID. outputs html directly.
{% endcomment %}
{% capture editnotice %}
Komentar lahko uredi samo tisti, ki ga je napisal. Komentar uredite v brskalniku, v katerem ste ga napisali. Bodisi piškotek bodisi IP naslov mora biti enak prejšnji oddaji komentarja. Če se objavo uredi še naslednjič, se to lahko stori iz katerega koli IP naslova in piškotka, ki se je uporabil pri predhodnih urejanjih.{% endcapture %}
{% assign comments = site.data.comments | where: "parent", argv[0] %}
{% unless argv[1] %}
	{% assign uid = 0 | minus: 1 %} <!-- začnemo z -1, ker se prvi sam poveča -->
	{% assign depth = 0 | minus: 1 %} <!-- začnemo z -1, da bo prvi na 0 -->
{% endunless %}
{% for comment in comments %}
	{% assign depth = depth | plus: 1 %}
	<div class="comment
		{% assign depthmodulo = depth | modulo: 2 %}
		{% if 0 == depthmodulo %}
			odd
		{% else %}
			even
		{% endif %}
	"> <!-- depth: {{ depth }} -->
		{% assign argv = comment.date | split: "," %} {% include datumincas.html %}
		<small class=dimmedtext style=width:100% >
			V {{ return }} je	{{ comment.author || replace: "<", "&lt;" }} komentiral:
		</small>
		<p>
			{% assign safemsg = comment.message | replace: "<", "&lt;" | replace: "!", "&#33;" %}
			{{ safemsg | markdownify }}
		</p>
		<small class=dimmedtext>
			<a href="mailto:anton@sijanec.eu?subject=Prijava%20neprimernega%20komentarja%20na%20blogu.">
				prijavi</a>
			|
			{% assign uid = uid | plus: 1 %}
			<label for=checkbox{{ uid }} >
				<a>
					odgovori</a>
			</label>
			<input type=checkbox id=checkbox{{ uid }} class=showhide-checkbox >
			<div class=showhide-hiddenelement>
				{% assign thisid = "comment|" | append: comment.nonce %}
				{% assign argv = thisid | append: "," | append: uid | split: "," %}
				{% include commentreplyform.html %} {{ return }}
			</div>
			|
			<label for=edit{{ uid }}>
				<a>uredi</a>
			</label>
			<input type=checkbox id=edit{{ uid }} class=showhide-checkbox >
			<div class=showhide-hiddenelement >
				<form class=commentform method=POST action=/api?m=commentedit target=editstatus{{ uid }} >
					<input type=text name=vzdevek value="{{ comment.author | replace: '&', "&amp;" | replace: '"', "&quot;" }}" />
					<input type=submit value=Uredi! />
					<textarea placeholder="{{ taplaceholder }}{{ editnotice }}" name=message >{{ safemsg | replace: "&#33;", "!" }}</textarea>
					<input type=hidden name=commentid value="{{ thisid | replace: '"', '&quot;' }}"/>
					<iframe id=editstatus{{ uid }} >{{ nepodpiraiframe }}</iframe>
				</form>
			</div>
		</small>
		{% assign argv = "true" | split: "," %}
		{% assign argv = argv | unshift: thisid %}
		{% include commentsthread.html %}
	</div>
	{% assign depth = depth | minus: 1 %}
{% endfor %}
{% assign return = uid | plus: 1 %}