store and display forum post ip
This commit is contained in:
parent
676b6c7e9e
commit
cb3754bcd9
|
@ -27,10 +27,8 @@ title = topic.name) {
|
|||
@authorLink(post, "author".some)
|
||||
@timeago(post.createdAt)
|
||||
<a class="anchor" href="@routes.ForumTopic.show(categ.slug, topic.slug, posts.currentPage)#@post.number">#@post.number</a>
|
||||
@if(isGranted(_.SuperAdmin)) {
|
||||
@post.ip.map { ip =>
|
||||
<a class="ipban" href="@routes.Mod.ipban(ip)">Ban @ip</a>
|
||||
}
|
||||
@if(isGranted(_.IpBan)) {
|
||||
<span class="postip">@post.ip</span>
|
||||
}
|
||||
@if(isGrantedMod(categ.slug)) {
|
||||
<a class="delete" href="@routes.ForumPost.delete(categ.slug, post.id)">Delete</a>
|
||||
|
|
|
@ -31,7 +31,7 @@ final class PostApi(
|
|||
topicId = topic.id,
|
||||
author = data.author,
|
||||
userId = ctx.me map (_.id),
|
||||
ip = ctx.isAnon option ctx.req.remoteAddress,
|
||||
ip = ctx.req.remoteAddress.some,
|
||||
text = data.text,
|
||||
number = number + 1,
|
||||
troll = ctx.troll,
|
||||
|
|
|
@ -591,15 +591,6 @@ var lichess_sri = Math.random().toString(36).substring(5); // 8 chars
|
|||
$('input.confirm, button.confirm').click(function() {
|
||||
return confirm('Confirm this action?');
|
||||
});
|
||||
$('a.ipban').one("click", function() {
|
||||
var $a = $(this);
|
||||
if (confirm($a.text() + "?")) {
|
||||
$.post($a.attr('href'), function() {
|
||||
$a.text('Done').attr('href', '#');
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#lichess').on('click', 'span.bookmark a.icon', function() {
|
||||
var t = $(this).toggleClass("bookmarked");
|
||||
|
|
|
@ -7,8 +7,9 @@ a.forum_feed_link {
|
|||
}
|
||||
|
||||
.metas .delete,
|
||||
.metas .ipban {
|
||||
.metas .postip {
|
||||
margin-left: 1em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.forum_topics_list .delete {
|
||||
margin-right: 1em;
|
||||
|
|
Loading…
Reference in a new issue