Files
gallery3/modules/comment/views/admin_manage_comments.html.php
Bharat Mediratta 743e2f88d8 Overhaul the Admin > Content > Comments page. Use a tabbed interface
for consistency with other parts of the admin UI (ie: G2 import).

The UI is now Ajax driven because that's how jQuery tabs works best in
this case.  This requires a little finagling in JS to get the
paginator links to load properly.  While I'm in there, add a paginator
at the top of the table, make the buttons in the delete tab sane and
smooth scroll back to the top of the tab when switching pages.

Fixes #1702
2011-04-26 21:02:43 -07:00

47 lines
1.3 KiB
PHP

<?php defined("SYSPATH") or die("No direct script access.") ?>
<script type="text/javascript">
var set_state_url =
<?= html::js_string(url::site("admin/manage_comments/set_state/__ID__/__STATE__?csrf=$csrf")) ?>;
var set_state = function(state, id) {
$("#g-comment-" + id).fadeOut("fast", function() {
$.get(set_state_url.replace("__STATE__", state).replace("__ID__", id),
{},
update_menu);
});
}
var update_menu = function() {
$.get(<?= html::js_string(url::site("admin/manage_comments/menu_labels")) ?>, {},
function(data) {
for (var i = 0; i < data.length; i++) {
$("#g-admin-comments ul li:eq(" + i + ") a").html(data[i]);
}
},
"json");
}
// Paginator clicks load their href in the active tab panel
var fix_links = function() {
$(".g-paginator a, a#g-delete-all-spam").click(function(event) {
event.stopPropagation();
$.scrollTo(0, 800, { easing: "swing" });
$(this).parents(".ui-tabs-panel").load(
$(this).attr("href"),
function() {
fix_links();
});
return false;
});
}
$(document).ready(function() {
$("#g-admin-comments").tabs({
show: fix_links,
});
});
</script>
<div id="g-admin-comments" class="g-block">
<?= $menu->render() ?>
</div>