login.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2017-03-15 21:16
  7. */
  8. /**
  9. * @var $this yii\web\View
  10. * @var $model backend\models\form\LoginForm
  11. */
  12. use backend\assets\AppAsset;
  13. use yii\helpers\Html;
  14. use backend\widgets\ActiveForm;
  15. use yii\helpers\Url;
  16. use yii\captcha\Captcha;
  17. AppAsset::register($this);
  18. $this->title = Yii::t('app', 'Login');
  19. $this->params['breadcrumbs'][] = $this->title;
  20. ?>
  21. <?php $this->beginPage() ?>
  22. <!DOCTYPE html>
  23. <html lang="<?= Yii::$app->language ?>">
  24. <head>
  25. <meta charset="<?= Yii::$app->charset ?>">
  26. <meta name="viewport" content="width=device-width, initial-scale=1">
  27. <meta name="renderer" content="webkit">
  28. <?= Html::csrfMetaTags() ?>
  29. <title><?= Html::encode($this->title) ?></title>
  30. <?php $this->head() ?>
  31. <?= $this->render("/widgets/_language-js") ?>
  32. <style>
  33. @media (min-width: 768px){
  34. div.form-group div.help-block {
  35. position: absolute;
  36. left: 305px;
  37. width: 170px;
  38. top: 4px;
  39. text-align: left;
  40. }
  41. }
  42. .form-horizontal .form-group {
  43. width: 300px;
  44. margin-left: 0px;
  45. }
  46. img#loginform-captcha-image{
  47. position: absolute;
  48. top: 2px;
  49. right: 1px;
  50. }
  51. </style>
  52. </head>
  53. <body class="gray-bg">
  54. <?php $this->beginBody() ?>
  55. <div class="middle-box text-center loginscreen animated fadeInDown">
  56. <?= $this->render('/widgets/_flash') ?>
  57. <div>
  58. <div>
  59. <h1 class="logo-name">H+</h1>
  60. </div>
  61. <h3><?= Yii::t('app', 'Welcome to') ?> Feehi CMS</h3>
  62. <?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
  63. <?= $form->field($model, 'username', ['template' => "<div style='position:relative'>{input}\n{error}\n{hint}</div>"])
  64. ->textInput(['autofocus' => true, 'placeholder' => Yii::t("app", "Username")]) ?>
  65. <?= $form->field($model, 'password', ['template' => "<div style='position:relative'>{input}\n{error}\n{hint}</div>"])
  66. ->passwordInput(['placeholder' => Yii::t("app", "Password")]) ?>
  67. <?= $form->field($model, 'captcha', ['template' => '<div style="position:relative">{input}{error}{hint}</div>'])->widget(Captcha::classname(), [
  68. 'template' => '{input}{image}',
  69. 'options' => [
  70. "class"=>"form-control",
  71. 'style' => "width:300px;height:34px;position:relative;top:2px",
  72. 'placeholder' => Yii::t("app", "Verification Code"),
  73. ],
  74. 'imageOptions' => [
  75. "style" => "cursor:pointer;right:0px"
  76. ]
  77. ]) ?>
  78. <?= Html::submitButton(Yii::t("app", "Login"), [
  79. 'class' => 'btn btn-primary block full-width m-b',
  80. 'name' => 'login-button'
  81. ]) ?>
  82. <p class="text-muted text-center">
  83. <a href="<?= Url::to(['admin-user/request-password-reset']) ?>">
  84. <small><?= Yii::t('app', 'Forgot password') ?></small>
  85. </a> |
  86. <?= $this->render("/widgets/_language-select") ?>
  87. </p>
  88. <?php ActiveForm::end(); ?>
  89. </div>
  90. </div>
  91. <?php $this->endBody() ?>
  92. </body>
  93. </html>
  94. <?php $this->endPage() ?>