<?php $this->headMeta('noindex', 'robots'); ?>
<div class="mb-3">
    <h1><?php _e('Reset password'); ?></h1>
</div>
<?php if (empty($result['status'])) { ?>
    <?php if (Pi::user()->config('is_mobile')) { ?>
        <p><?php _e('Enter your mobile phone address below and we’ll reset and send you an new password by SMS.'); ?></p>
    <?php } else { ?>
        <p><?php _e('Enter your email address below and we’ll send you an email allowing you to reset it.'); ?></p>
    <?php } ?>
    <?php if (!empty($result)) {
        echo sprintf(
            '<div class="alert alert-warning"><a href="#" data-dismiss="alert" class="close">&times;</a>%s</div>',
            $result['message']);
    } ?>
    <?php echo $this->form($form); ?>
<?php } else { ?>
    <p><?php echo _escape($result['message']); ?></p>
    <p><?php
        echo sprintf('<a class="btn btn-primary" href="%s">' . __('Login') . '</a>.',
            Pi::service('authentication')->getUrl('login', ['redirect' => $result['redirect']])
        ); ?></p>
<?php } ?>
