mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[feature/soft-delete] Update restoring feature to use ajax if requested.
Also fixes the mcp as a hole: - displayes a success message - gives a link to the post, if only one was restored PHPBB3-9657
This commit is contained in:
@@ -24,8 +24,8 @@ phpbb.add_ajax_callback('post_delete', function() {
|
||||
});
|
||||
|
||||
// This callback removes the approve / disapprove div or link.
|
||||
phpbb.add_ajax_callback('post_approve', function(res) {
|
||||
var remove = (res.approved) ? $(this) : $(this).parents('.post');
|
||||
phpbb.add_ajax_callback('post_visibility', function(res) {
|
||||
var remove = (res.visible) ? $(this) : $(this).parents('.post');
|
||||
$(remove).css('pointer-events', 'none').fadeOut(function() {
|
||||
$(this).remove();
|
||||
});
|
||||
|
@@ -139,7 +139,7 @@
|
||||
<p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF -->{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> » {postrow.POST_DATE} </p>
|
||||
|
||||
<!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_DELETED or postrow.S_POST_REPORTED -->
|
||||
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}" data-ajax="post_approve">
|
||||
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}" data-ajax="post_visibility">
|
||||
<p class="rules">
|
||||
<!-- IF postrow.S_POST_UNAPPROVED -->
|
||||
{UNAPPROVED_IMG} <strong>{L_POST_UNAPPROVED}</strong>
|
||||
@@ -147,8 +147,15 @@
|
||||
<input class="button1" type="submit" value="{L_APPROVE}" name="action[approve]" />
|
||||
<input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
|
||||
{S_FORM_TOKEN}
|
||||
<br /><!-- ENDIF -->
|
||||
<!-- IF postrow.S_POST_DELETED -->{DELETED_IMG} <a href="{postrow.U_MCP_RESTORE}"><strong>{L_POST_DELETED_RESTORE}</strong></a><br /><!-- ENDIF -->
|
||||
<br />
|
||||
<!-- ELSEIF postrow.S_POST_DELETED -->
|
||||
{DELETED_IMG} <strong>{L_POST_DELETED}</strong>
|
||||
<input class="button2" type="submit" value="{L_DELETE}" name="action[disapprove]" />
|
||||
<input class="button1" type="submit" value="{L_RESTORE}" name="action[restore]" />
|
||||
<input type="hidden" name="post_id_list[]" value="{postrow.POST_ID}" />
|
||||
{S_FORM_TOKEN}
|
||||
<br />
|
||||
<!-- ENDIF -->
|
||||
<!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
|
||||
</p>
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user