v1.18.x
barisusakli 9 years ago
parent f0b333e8a1
commit 1449d438f5

@ -25,7 +25,7 @@ define('admin/manage/flags', [
function handleDismiss() { function handleDismiss() {
$('.flags').on('click', '.dismiss', function() { $('.flags').on('click', '.dismiss', function() {
var btn = $(this); var btn = $(this);
var pid = btn.siblings('[data-pid]').attr('data-pid'); var pid = btn.parents('[data-pid]').attr('data-pid');
socket.emit('admin.dismissFlag', pid, function(err) { socket.emit('admin.dismissFlag', pid, function(err) {
done(err, btn); done(err, btn);
@ -49,11 +49,11 @@ define('admin/manage/flags', [
$('.flags').on('click', '.delete', function() { $('.flags').on('click', '.delete', function() {
var btn = $(this); var btn = $(this);
bootbox.confirm('Do you really want to delete this post?', function(confirm) { bootbox.confirm('Do you really want to delete this post?', function(confirm) {
if(!confirm) { if (!confirm) {
return; return;
} }
var pid = btn.siblings('[data-pid]').attr('data-pid'); var pid = btn.parents('[data-pid]').attr('data-pid');
var tid = btn.siblings('[data-pid]').attr('data-tid'); var tid = btn.parents('[data-pid]').attr('data-tid');
socket.emit('posts.delete', {pid: pid, tid: tid}, function(err) { socket.emit('posts.delete', {pid: pid, tid: tid}, function(err) {
done(err, btn); done(err, btn);
}); });
@ -65,7 +65,7 @@ define('admin/manage/flags', [
if (err) { if (err) {
return app.alertError(err.messaage); return app.alertError(err.messaage);
} }
btn.parent().fadeOut(function() { btn.parents('[data-pid]').fadeOut(function() {
$(this).remove(); $(this).remove();
if (!$('.flags [data-pid]').length) { if (!$('.flags [data-pid]').length) {
$('.post-container').text('No flagged posts!'); $('.post-container').text('No flagged posts!');

@ -36,9 +36,9 @@
<!-- ENDIF !posts.length --> <!-- ENDIF !posts.length -->
<!-- BEGIN posts --> <!-- BEGIN posts -->
<div class="row"> <div class="row" data-pid="{posts.pid}" data-tid="{posts.topic.tid}">
<div class="col-sm-8"> <div class="col-sm-8">
<div class="panel panel-default" data-pid="{posts.pid}" data-tid="{posts.topic.tid}"> <div class="panel panel-default">
<div class="panel-body flag-post-body"> <div class="panel-body flag-post-body">
<a href="{config.relative_path}/user/{../user.userslug}"> <a href="{config.relative_path}/user/{../user.userslug}">
<!-- IF ../user.picture --> <!-- IF ../user.picture -->

Loading…
Cancel
Save