Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/templates/placebo/post.mustache
Jeff Becker cbc8528f4c
more
2019-03-02 11:26:24 -05:00

72 lines
2.9 KiB
Plaintext

<div id="{{post.PostHash}}"
{{#post.OP}}
class="messageroot post"
{{/post.OP}}
{{^post.OP}}
class="message post"
{{/post.OP}}
data-name="{{post.Name}}"
data-frontend="{{post.Frontend}}"
data-newsgroup="{{post.Board}}"
data-msgid="{{post.MessageID}}"
data-msgidhash="{{post.PostHash}}"
data-rootmsgid="{{post.Reference}}"
data-rootmsgidhash="{{post.ReferenceHash}}"
data-pubkey="{{post.PubkeyHex}}"
{{#post.Sage}}
data-sage="1"
{{/post.Sage}}
{{#post.IsI2P}}
data-origin="i2p"
{{/post.IsI2P}}
{{#post.IsTor}}
data-origin="tor"
{{/post.IsTor}}
{{#post.IsClearnet}}
data-origin="clearnet"
{{/post.IsClearnet}}
data-frontendpubkey="{{post.FrontendPubkey}}"
data-posturl="{{post.PostURL}}">
{{#post.Attachments}}
<a href="{{Source}}" class="image_link" target="_blank" title="{{Filename}}"><img src="{{Thumbnail}}" class="image" /></a>
{{/post.Attachments}}
<span class="mod" onclick="nntpchan_mod_delete('{{post.PostHash}}');">[Delete]</span>
<span class="mod" onclick="nntpchan_mod_mark_spam('{{post.PostHash}}');">[Spam]</span>
{{#post.IsCtl}}
<span class="mod" onclick="nntpchan_mod_trust_mod('{{post.PubkeyHex}}', this);">[Trust Moderator]</span>
<span class="mod" onclick="nntpchan_mod_untrust_mod('{{post.PubkeyHex}}', this);">[UnTrust Moderator]</span>
<span class="mod" onclick="nntpchan_mod_decode_ipban('{{post.PostHash}}');">[Decode Secrets]</span>
{{/post.IsCtl}}
<a name="{{post.PostHash}}"></a><span class="topicline"><b data-subject="{{post.Subject}}" class="subject">{{post.Subject}}</b> {{post.Name}} <span class="published">{{post.Frontend}} || {{post.Date}}</span> {{{post.Pubkey}}} <a href="{{post.PostURL}}">[Reply]</a>
<a href="#" onclick="return quickreply('{{post.ShortHash}}', '{{post.PostHash}}', '{{post.PostURL}}');"> {{post.ShortHash}}</a>
</span>
<br /><br />
<span id="post_body_{{post.PostHash}}" class="message_span">{{{post.RenderBody}}}</span>
{{#post.OP}}
<script type="text/javascript">
fetch("/api/find?hash={{post.PostHash}}").then(function(resp) {
return resp.json();
}).then(function(j) {
console.log(j);
if (j.length) {
var e = document.getElementById("post_body_{{post.PostHash}}");
if(e) {
var u = new URL(j[0].ReferencedURI);
if(u.protocol === "https" || u.protocol === "http") {
var link = document.createElement("a");
link.href = u.toString();
link.innerText = "[Link]";
e.appendChild(txt);
}
}
else throw "wut";
}
}).catch(function(resp) {
});
</script>
{{/post.OP}}
<br style="clear: both;" />
</div>