store and display forum post ip

This commit is contained in:
Thibault Duplessis 2013-06-11 17:06:27 +02:00
parent 676b6c7e9e
commit cb3754bcd9
5 changed files with 6 additions and 15 deletions

View file

@ -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>

View file

@ -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,

View file

@ -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");

View file

@ -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;

1
todo
View file

@ -66,6 +66,7 @@ allow to filter anon
replace plot with watch plot when game starts
lobby table sort
disable unused websocket hijack protection
disable init lobby fadeIn
---