login.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. <?
  68. /*= $form->field($model, 'captcha', ['template' => '<div style="position:relative">{input}{error}{hint}</div>'])->widget(Captcha::classname(), [
  69. 'template' => '{input}{image}',
  70. 'options' => [
  71. "class"=>"form-control",
  72. 'style' => "width:300px;height:34px;position:relative;top:2px",
  73. 'placeholder' => Yii::t("app", "Verification Code"),
  74. ],
  75. 'imageOptions' => [
  76. "style" => "cursor:pointer;right:0px"
  77. ]
  78. ]) */
  79. ?>
  80. <?= Html::submitButton(Yii::t("app", "Login"), [
  81. 'class' => 'btn btn-primary block full-width m-b',
  82. 'name' => 'login-button'
  83. ]) ?>
  84. <p class="text-muted text-center">
  85. <a href="<?= Url::to(['admin-user/request-password-reset']) ?>">
  86. <small><?= Yii::t('app', 'Forgot password') ?></small>
  87. </a> |
  88. <?= $this->render("/widgets/_language-select") ?>
  89. </p>
  90. <?php ActiveForm::end(); ?>
  91. </div>
  92. </div>
  93. <?php $this->endBody() ?>
  94. </body>
  95. </html>
  96. <?php $this->endPage() ?>