<Mt:setvar name="page_title" value="<__trans phrase="IP Banning Settings">">
<mt:setvar name="ip_info" value="1">
<MTSetVarBlock name="html_head" append="1">
<script type="text/javascript">
/* <![CDATA[ */
function setCreateMode () {
    jQuery('#create-ip').hide();
    jQuery('#create-inline-ipban').show();
    jQuery('#actions-bar-top').hide();
    jQuery('#ip-address').val('').focus();
}

function cancelCreateMode () {
    jQuery('#create-ip').show();
    jQuery('#create-inline-ipban').hide();
    jQuery('#actions-bar-top').show();
}
/* ]]> */
</script>
</MTSetVarBlock>
<mt:setvarblock name="action_buttons">
    <button
        onclick="doRemoveItems(getByID('<$mt:var name="object_type"$>-listing-form'), '<__trans phrase="IP address" escape="js">', '<__trans phrase="IP addresses" escape="js">')" type="button" value="<__trans phrase="Delete">"
        accesskey="x"
        title="<__trans phrase="Delete selected IP Address (x)">"
        ><__trans phrase="Delete"></button>
</mt:setvarblock>
<mt:setvarblock name="system_msg">
    <mt:if name="error">
    <mtapp:statusmsg
        id="generic-error"
        class="error">
        <mt:var name="error">
    </mtapp:statusmsg>
    </mt:if>

    <mt:if name="saved">
        <mtapp:statusmsg
            id="saved"
            class="success">
            <__trans phrase="You have added [_1] to your list of banned IP addresses." params="<mt:var name="saved" escape="html" escape="html">">
        </mtapp:statusmsg>
    </mt:if>

    <mt:if name="saved_deleted">
        <mtapp:statusmsg
            id="saved-deleted"
            class="success">
            <__trans phrase="You have successfully deleted the selected IP addresses from the list.">
        </mtapp:statusmsg>
    </mt:if>
</mt:setvarblock>
<mt:setvarblock name="content_header">
    <mt:if name="show_ip_info">
    <ul id="create-ip" class="action-link-list">
        <li><a href="javascript:void(0)" onclick="setCreateMode()" class="icon-left icon-create"><__trans phrase="Ban IP Address"></a></li>
    </ul>
    </mt:if>
</mt:setvarblock>
<mt:include name="include/header.tmpl">

<div id="create-inline-ipban" class="create-inline">
    <form id="create-inline-ipban-form" method="post" action="<mt:var name="script_url">">
        <input type="hidden" name="blog_id" value="<mt:var name="blog_id">" />
        <input type="hidden" name="__mode" value="save" />
        <input type="hidden" name="_type" value="banlist" />
        <input type="hidden" name="return_args" value="<mt:var name="return_args" escape="html">" />
        <input type="hidden" name="magic_token" value="<mt:var name="magic_token">" />
        <mtapp:setting
            id="ip-address"
            label="<__trans phrase="IP Address">"
            label_class="inline"
            hint=""
            show_hint="0">
            <input type="text" name="ip" id="ip-address" value="<mt:var name="ip" escape="html">" maxlength="15" />
            <button
                type="submit"
                class="small-button"
                ><__trans phrase="Save"></button> 
            <button
                type="button"
                class="small-button mt-cancel-action"
               ><__trans phrase="Cancel"></button> 
        </mtapp:setting>
    </form>
</div>

<mtapp:listing
    id="banlist-listing"
    empty_message="<__trans phrase="No IP Address is banned.">"
    hide_pager="1">
    <mt:if name="__first__">

        <mt:setvarblock name="table_header">
        <tr>
            <th class="cb"><input type="checkbox" value="all" class="select" /></th>
            <th class="ip primary-col"><__trans phrase="IP Address"></th>
            <th class="datetime"><__trans phrase="Date Banned"></th>
        </tr>
        </mt:setvarblock>

    <thead>
        <mt:var name="table_header">
    </thead>
    <tfoot>
        <mt:var name="table_header">
    </tfoot>
    <tbody>
    </mt:if>
        <tr class="<mt:if name="__odd__">odd<mt:else>even</mt:if>">
            <td class="cb"><input type="checkbox" name="id" class="select" value="<mt:var name="id" escape="html">" /></td>
            <td class="ip"><mt:var name="ip" escape="html"></td>
            <td class="datetime"><mt:var name="created_on_formatted"></td>
        </tr>
    <mt:if name="__last__">
    </tbody>
    </mt:if>
</mtapp:listing>

<mt:setvarblock name="jq_js_include" append="1">
    jQuery.mtCheckbox();

    jQuery('button.mt-do-action').click(function() {
        jQuery('#create-inline-ipban-form').submit();
    });
    jQuery('button.mt-cancel-action').click(function() {
        cancelCreateMode();
        return false;
    });
</mt:setvarblock>
<mt:include name="include/footer.tmpl">
