<?php require_once(THEME_ROOT . '/blocks/head.php'); ?>
<?php require_once(THEME_ROOT . '/blocks/top.php'); ?>

    <br><br>

    <div class="row">
        <div class="col-sm-12 col-md-6 col-md-offset-3">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo T('Вход'); ?></h3>
                </div>
                <div class="panel-body">

                    <form method=post action="/handlers/login.php">
                        <?php echo form_init(); ?>
                        <?php echo flash_show('login'); ?>
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-user"></span>
                            </span>
                            <?php $login_by = auth_login_by(); ?>
                            <input
                                    name="<?php echo escape($login_by['name']); ?>"
                                    type="<?php echo escape($login_by['type']); ?>"
                                    value="<?php echo DEMO ? "admin" : escape(post($login_by['name'])); ?>"
                                    class="form-control"
                                    placeholder="<?php echo T(escape($login_by['placeholder'])); ?>"
                                    required autofocus>
                        </div>
                        <br>
                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon glyphicon-lock"></span>
                            </span>
                            <input
                                    name="password"
                                    type="password"
                                    class="form-control"
                                    value="<?php echo DEMO ? "admin" : ""; ?>"
                                    placeholder="<?php echo T('Пароль'); ?> "
                                    required>
                        </div>
                        <br>

                        <?php if ($settings_define_recaptcha_on_login) { ?>
                            <div id="captcha_login" style="width: 304px; margin: auto;"></div>
                            <br>
                        <?php } ?>

                        <input type="submit" value="<?php echo T('Вход'); ?>" class="btn btn-default btn-md" style="width: 100%;">
                    </form>

                    <div class="row">
                        <div class="col-sm-12 col-md-6">
                            <br>
                            <a href="/signup/" class="btn btn-default btn-md" style="width: 100%;">
                                <?php echo T('Регистрация'); ?>
                            </a>
                        </div>
                        <div class="col-sm-12 col-md-6">
                            <br>
                            <a href="/forgot" class="btn btn-default btn-md" style="width: 100%;">
                                <?php echo T('Забыли пароль?'); ?>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php
    require_once(THEME_ROOT."/blocks/footer.php");
?>