account.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /*
  3. * This file is part of the Dektrium project.
  4. *
  5. * (c) Dektrium project <http://github.com/dektrium>
  6. *
  7. * For the full copyright and license information, please view the LICENSE.md
  8. * file that was distributed with this source code.
  9. */
  10. use yii\helpers\Html;
  11. use yii\widgets\ActiveForm;
  12. /**
  13. * @var yii\web\View $this
  14. * @var yii\widgets\ActiveForm $form
  15. * @var dektrium\user\models\SettingsForm $model
  16. */
  17. $this->title = Yii::t('user', 'Account settings');
  18. $this->params['breadcrumbs'][] = $this->title;
  19. ?>
  20. <?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
  21. <div class="row">
  22. <div class="col-md-3">
  23. <?= $this->render('_menu') ?>
  24. </div>
  25. <div class="col-md-9">
  26. <div class="panel panel-default">
  27. <div class="panel-heading">
  28. <h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
  29. </div>
  30. <div class="panel-body">
  31. <?php $form = ActiveForm::begin([
  32. 'id' => 'account-form',
  33. 'options' => ['class' => 'form-horizontal'],
  34. 'fieldConfig' => [
  35. 'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
  36. 'labelOptions' => ['class' => 'col-lg-3 control-label'],
  37. ],
  38. 'enableAjaxValidation' => true,
  39. 'enableClientValidation' => false,
  40. ]); ?>
  41. <?= $form->field($model, 'email') ?>
  42. <?= $form->field($model, 'username') ?>
  43. <?= $form->field($model, 'new_password')->passwordInput() ?>
  44. <hr/>
  45. <?= $form->field($model, 'current_password')->passwordInput() ?>
  46. <div class="form-group">
  47. <div class="col-lg-offset-3 col-lg-9">
  48. <?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?><br>
  49. </div>
  50. </div>
  51. <?php ActiveForm::end(); ?>
  52. </div>
  53. </div>
  54. <?php if ($model->module->enableAccountDelete): ?>
  55. <div class="panel panel-danger">
  56. <div class="panel-heading">
  57. <h3 class="panel-title"><?= Yii::t('user', 'Delete account') ?></h3>
  58. </div>
  59. <div class="panel-body">
  60. <p>
  61. <?= Yii::t('user', 'Once you delete your account, there is no going back') ?>.
  62. <?= Yii::t('user', 'It will be deleted forever') ?>.
  63. <?= Yii::t('user', 'Please be certain') ?>.
  64. </p>
  65. <?= Html::a(Yii::t('user', 'Delete account'), ['delete'], [
  66. 'class' => 'btn btn-danger',
  67. 'data-method' => 'post',
  68. 'data-confirm' => Yii::t('user', 'Are you sure? There is no going back'),
  69. ]) ?>
  70. </div>
  71. </div>
  72. <?php endif ?>
  73. </div>
  74. </div>