<?php
namespace JetStudio;

use Jet\Tr;
use Jet\UI;
use Jet\Form;
use Jet\MVC_View;

/**
 * @var MVC_View $this
 * @var Form $form
 */
$form = $this->getRaw( 'login_form' );

$form->field( 'username' )->setPlaceholder( 'username' );
$form->field( 'password' )->setPlaceholder( 'password' );

?>
<div class="card">
	<h5 class="card-header">
		<?= Tr::_( 'Sign In' ) ?>
	</h5>

	<?= $form->start() ?>
	<div class="card-body">
		<?php if( $form->getCommonMessage() ): ?>
			<div id="login-alert" class="alert alert-danger">
				<?= $form->getCommonMessage() ?>
			</div>
		<?php endif; ?>

		<div style="margin-bottom: 25px" class="input-group">
			<div class="input-group-prepend">
				<span class="input-group-text"><?= UI::icon( 'user' ) ?></span>
			</div>
			<?= $form->field( 'username' )->input() ?>
		</div>

		<div style="margin-bottom: 25px" class="input-group">
			<div class="input-group-prepend">
				<span class="input-group-text"><?= UI::icon( 'lock' )->setTag( 'i' ) ?></span>
			</div>
			<?= $form->field( 'password' )->input() ?>
		</div>

		<div class="text-right">
			<input type="submit" class="btn btn-primary" value="<?= Tr::_( 'Sign In' ) ?>"/>
		</div>
	</div>
	<?= $form->end() ?>
</div>