Skip to content

Commit

Permalink
views/site/login
Browse files Browse the repository at this point in the history
  • Loading branch information
hail committed Apr 24, 2020
1 parent 6a4df8f commit 26dd8ef
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/views/layouts/main-login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/* @var $this \yii\web\View */
/* @var $content string */

\hail812\adminlte3\assets\AdminLteAsset::register($this);
\hail812\adminlte3\assets\FontAwesomeAsset::register($this);
$this->registerCssFile('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700');
$this->registerCssFile('https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css');

\hail812\adminlte3\assets\PluginAsset::register($this)->add('icheck-bootstrap');
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 3 | Log in</title>
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $this->registerCsrfMetaTags() ?>
<?php $this->head() ?>
</head>
<body class="hold-transition login-page">
<?php $this->beginBody() ?>
<div class="login-box">
<div class="login-logo">
<a href="<?=Yii::$app->homeUrl?>"><b>Admin</b>LTE</a>
</div>
<!-- /.login-logo -->

<?= $content ?>
</div>
<!-- /.login-box -->

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
60 changes: 60 additions & 0 deletions src/views/site/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
use yii\helpers\Html;
?>
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">Sign in to start your session</p>

<?php $form = \yii\bootstrap4\ActiveForm::begin(['id' => 'login-form']) ?>

<?= $form->field($model,'username', [
'options' => ['class' => 'form-group has-feedback'],
'inputTemplate' => '{input}<div class="input-group-append"><div class="input-group-text"><span class="fas fa-envelope"></span></div></div>',
'template' => '{beginWrapper}{input}{error}{endWrapper}',
'wrapperOptions' => ['class' => 'input-group mb-3']
])
->label(false)
->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>

<?= $form->field($model, 'password', [
'options' => ['class' => 'form-group has-feedback'],
'inputTemplate' => '{input}<div class="input-group-append"><div class="input-group-text"><span class="fas fa-lock"></span></div></div>',
'template' => '{beginWrapper}{input}{error}{endWrapper}',
'wrapperOptions' => ['class' => 'input-group mb-3']
])
->label(false)
->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>

<div class="row">
<div class="col-8">
<div class="icheck-primary">
<?= $form->field($model, 'rememberMe')->checkbox() ?>
</div>
</div>
<div class="col-4">
<?= Html::submitButton('Sign In', ['class' => 'btn btn-primary btn-block']) ?>
</div>
</div>

<?php \yii\bootstrap4\ActiveForm::end(); ?>

<div class="social-auth-links text-center mb-3">
<p>- OR -</p>
<a href="#" class="btn btn-block btn-primary">
<i class="fab fa-facebook mr-2"></i> Sign in using Facebook
</a>
<a href="#" class="btn btn-block btn-danger">
<i class="fab fa-google-plus mr-2"></i> Sign in using Google+
</a>
</div>
<!-- /.social-auth-links -->

<p class="mb-1">
<a href="forgot-password.html">I forgot my password</a>
</p>
<p class="mb-0">
<a href="register.html" class="text-center">Register a new membership</a>
</p>
</div>
<!-- /.login-card-body -->
</div>

0 comments on commit 26dd8ef

Please sign in to comment.