<mt:setvarblock name="page_title"><__trans phrase="Manage Comments"></mt:setvarblock>
<mt:setvarblock name="system_msg">
    <mt:if name="saved">
        <mtapp:statusmsg
            id="saved"
            class="success" rebuild="all">
            <__trans phrase="Your changes have been saved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="approved">
        <mtapp:statusmsg
            id="approved"
            class="success">
            <__trans phrase="The selected comment(s) has been approved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="emptied">
        <mtapp:statusmsg
            id="emptied"
            class="success">
            <__trans phrase="All comments reported as spam have been removed.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="unapproved">
        <mtapp:statusmsg
            id="unapproved"
            class="success">
            <__trans phrase="The selected comment(s) has been unapproved.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="junked">
        <mtapp:statusmsg
            id="junked"
            class="success">
            <__trans phrase="The selected comment(s) has been reported as spam.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="unjunked">
        <mtapp:statusmsg
            id="unjunked"
            class="success">
            <__trans phrase="The selected comment(s) has been recovered from spam.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="saved_deleted">
        <mtapp:statusmsg
            id="saved-deleted"
            class="success">
            <__trans phrase="The selected comment(s) has been deleted from the database.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="unauth">
        <mtapp:statusmsg
            id="unaugh"
            class="alert">
            <__trans phrase="One or more comments you selected were submitted by an unauthenticated commenter. These commenters cannot be Banned or Trusted.">
        </mtapp:statusmsg>
    </mt:if>
    <mt:if name="no_junk_found">
        <mtapp:statusmsg
            id="no-junk-found"
            class="info">
            <__trans phrase="No comments appeared to be spam.">
        </mtapp:statusmsg>
    </mt:if>
</mt:setvarblock>
<mt:setvarblock name="related_content">
    <mtapp:widget
        id="quickfilters"
        label="<__trans phrase="Quickfilters">">
        <$mtapp:ListFilters$>
    <mt:if name="scope_type" eq="blog">
        <ul>
            <li>
            <mt:if name="feed_url">
                <a href="<mt:var name="feed_url" escape="html">" class="icon-feed icon-left" title="<mt:var name="feed_name" escape="html">"><__trans phrase="[_1] Feed" params="<$mt:var name="object_label_plural"$>"></a>
            <mt:else>
                <a href="<mt:var name="mt_url">?__mode=view&amp;_type=author&amp;id=<mt:var name="author_id" escape="url">" class="icon-feed-disabled icon-left" title="<__trans phrase="[_1] (Disabled)" params="<$mt:var name="feed_name" escape="html"$>">"><__trans phrase="Set Web Services Password"></a>
            </mt:if>
            </li>
        </ul>
    </mt:if>
    </mtapp:widget>
    <$mtapp:PageActions from="$mode"$$>
</mt:setvarblock>
<mt:setvarblock name="html_body_footer">
    <$mt:include name="include/display_options.tmpl"$>
</mt:setvarblock>
<mt:setvarblock name="html_head" append="1">
<script type="text/javascript">
/* <![CDATA[ */
function enableFilterButton() {
    jQuery('#filter-button').css('display', 'inline');
}

function toggleFilter() {
    jQuery('#filter-title').toggle();
    jQuery('#filter-select').toggle();
}

function setFilterCol(choice) {
    if (!jQuery('#filter-select').length) return;
    if (choice != 'none') {
        jQuery('#filter-select span').not('.buttons').hide();
        jQuery('#filter-'+choice).show().addClass('filter-'+choice);
        jQuery('#filter-col').val(choice);
        jQuery('#filter-text-col').html('<strong>'+jQuery('#filter-col option:selected').text()+'</strong>');
    }
}

function doBanIP (ip) {
  window.location = ("<mt:var name="script_url">"
    + "?__mode=save&amp;_type=banlist"<mt:if name="blog_id">
    + "&amp;blog_id=<mt:var name="blog_id">"</mt:if>
    + "&amp;magic_token=<mt:var name="magic_token">&amp;ip=" + ip);
}

function init()
{
    setFilterCol(<mt:if name="filter">'<mt:var name="filter" escape="js">'<mt:else>'none'</mt:if>);<mt:if name="filter">
    setFilterVal('<mt:var name="filter_val" escape="js">');</mt:if>
}
/* ]]> */
</script>
</mt:setvarblock>
<mt:setvarblock name="list_filter_form">
<form id="filter-form" method="get" action="<mt:var name="mt_url">">
    <input type="hidden" name="__mode" value="list_<$mt:var name="object_type"$>" />
        <mt:if name="blog_id">
    <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
        </mt:if>
    <input id="filter" type="hidden" name="filter" value="" />
    <input id="filter_val" type="hidden" name="filter_val" value="" />
</form>
<div class="listing-filter">
    <div class="listing-filter-inner inner pkg">
        <form id="filter-select-form" method="get" onsubmit="execFilter(this)">
            <div class="filter">
                <div id="filter-title" class="filter-title">
            <mt:unless name="filter">
                    <strong><__trans phrase="All [_1]" params="<$mt:var name="object_label_plural"$>"></strong>
                    <!-- <a href="javascript:void(0)" onclick="toggleFilter()" class="filter-link">[ <__trans phrase="change"> ]</a> -->
            <mt:else>
                <mt:if name="filter_key">
                    <strong><__trans phrase="Showing only: [_1]" params="<mt:var name="filter_label" escape="html" escape="html">"></strong>
                    <!-- <a href="javascript:void(0)" onclick="toggleFilter()" class="filter-link">[ <__trans phrase="change"> ]</a> -->
                <mt:else>
                    <strong>
                    <mt:if name="filter_newentry">
                        <__trans phrase="[_1] on entries created within the last [_2] days" params="<$mt:var name="object_label_plural"$>%%<mt:var name="filter_val" escape="html">">
                    <mt:else>
                        <mt:if name="filter_oldentry">
                        <__trans phrase="[_1] on entries created more than [_2] days ago" params="<$mt:var name="object_label_plural"$>%%<mt:var name="filter_val" escape="html">">
                        <mt:else>
                        <__trans phrase="[_1] where [_2] is [_3]" params='<$mt:var name="object_label_plural"$>%%<span id="filter-text-col">&nbsp;</span>%%<span id="filter-text-val"></span>'>
                        </mt:if>
                    </mt:if>
                </strong>
                <a href="<mt:var name="script_url">?__mode=<mt:var name="mode" escape="url"><mt:if name="blog_id">&amp;blog_id=<mt:var name="blog_id"></mt:if><mt:if name="is_power_edit">&amp;is_power_edit=1</mt:if>">[ <__trans phrase="Remove filter"> ]</a>
                </mt:if>
        <div id="filter-select" class="page-title" style="display: none">
            <!-- start filter form -->
                <select id="filter-col" name="filter" onchange="setFilterCol(this.options[this.selectedIndex].value);enableFilterButton(this)">
                    <option value="status"><__trans phrase="status"></option>
                </select>
                <__trans phrase="is">
                <span id="filter-status" style="display: none">
                    <select id="status-val" name="filter_val" onchange="enableFilterButton()">
                        <option value="approved"><__trans phrase="approved"></option>
                        <option value="pending"><__trans phrase="pending"></option>
                        <option value="junk"><__trans phrase="spam"></option>
                    </select>
                </span>
        </div>
            </mt:unless>
                </div>
            </div>
        </form>
    </div>
</div>
</mt:setvarblock>

<mt:include name="include/header.tmpl">
<$mt:var name="list_filter_form"$>
<mt:include name="include/comment_table.tmpl">
<mt:setvarblock name="jq_js_include" append="1">
    init();
    jQuery.mtCheckbox();
</mt:setvarblock>
<mt:include name="include/footer.tmpl">
