<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @var $this Mage_Oauth_Block_Customer_Token_List */
?>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<div class="page-title">
    <h1><?php echo $this->__('My Applications') ?></h1>
</div>
<?php if ($this->getCollection() && $this->count()): ?>
    <?php echo $this->getToolbarHtml() ?>
        <table class="data-table" id="my-apps-table">
            <col />
            <col width="100" align="right" />
            <col width="110" align="right" />
            <thead>
                <tr>
                    <th><?php echo $this->__('App Name') ?></th>
                    <th><?php echo $this->__('Status') ?></th>
                    <th>&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                <?php /** @var $item Mage_Oauth_Model_Token */ ?>
                <?php foreach ($this->getCollection() as $item) : ?>
                <tr>
                    <td><span class="app-name">
                        <?php echo $this->escapeHtml($item->getName()); ?></span></td>
                    <td><em><?php echo $this->getStatusLabel($item->getRevoked()) ?></em></td>
                    <td align="right">
                        <a href="<?php echo $this->getUpdateRevokeLink($item)?>" class="nobr"
                            onclick="return confirm('<?php echo $this->getChangeStatusConfirmMessage($item->getRevoked()) ?>')">
                            <?php echo $this->getChangeStatusLabel($item->getRevoked()) ?></a>
                        <span class="separator">|</span> <a href="<?php echo $this->getDeleteLink($item)?>" class="nobr"
                            onclick="return confirm('<?php echo $this->__('Are you sure you want to delete this application?') ?>')">
                        <?php echo $this->__('Delete') ?></a></td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        <script type="text/javascript">
        //<![CDATA[
            decorateTable('my-apps-table');
        //]]>
        </script>
    <?php echo $this->getToolbarHtml() ?>
<?php else: ?>
    <p><?php echo $this->__('You have no applications.'); ?></p>
<?php endif; ?>
