<?php
/**
 * Maho
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/**
 * Admin login form template
 *
 * @var Mage_Oauth_Block_AuthorizeBaseAbstract $this
 */
?>
<div class="content-container">
    <div class="login-box">
        <div class="page-title">
            <h1><?= $this->__('Log In') ?></h1>
        </div>
        <div class="form-box">
            <?= $this->getMessagesBlock()->toHtml() ?>
            <?php if (!$this->getHasException()) : ?>
            <form method="post" action="<?= $this->getPostActionUrl() ?>" id="loginForm">
                <?= $this->getBlockHtml('formkey') ?>
                <fieldset class="fieldset">
                    <h2 class="legend"><?= $this->getFormTitle() ?></h2>
                    <p class="description"><?= $this->__('Log in to use <strong>%s</strong>', $this->getConsumer()->getName()) ?></p>
                    <div class="login-form simple">
                            <input name="form_key" type="hidden" value="<?= $this->getFormKey() ?>"/>
                            <input type="hidden" name="oauth_token" value="<?= $this->escapeHtml($this->getToken()) ?>"/>

                            <div class="input-box input-left">
                                <label for="username">
                                    <em class="required">*</em>&nbsp;<?= $this->getIdentityLabel() ?>
                                </label>
                                <input type="text" id="username" name="login[username]" value="" class="required-entry input-text"/>
                            </div>
                            <div class="clear"></div>
                            <div class="input-box input-right">
                                <label for="login">
                                    <em class="required">*</em>&nbsp;<?= $this->__('Password') ?>
                                </label>
                                <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
                                <input type="password" class="input-text no-display" name="dummy" id="dummy" />
                                <input type="password" id="login" name="login[password]" class="required-entry input-text"
                                       value="" autocomplete="new-password"/></div>
                            <div class="clear"></div>
                            <div class="form-buttons">
                                <button type="submit" class="form-button"
                                       title="<?= $this->quoteEscape($this->__('Login')) ?>"/><?= $this->__('Login') ?></button>
                                <button type="button" onclick="document.location.href='<?= $this->getRejectUrl() ?>';"
                                        title="<?= $this->quoteEscape($this->__('Reject')) ?>"><?= $this->__('Reject') ?></button>
                                <p class="required"><?= $this->__('* Required Fields') ?></p>
                            </div>
                        </div>
                    </fieldset>
                </form>
            <?php endif ?>
        </div>
        <div class="bottom"></div>
    </div>
</div>
