80 lines
2.9 KiB
PHP
80 lines
2.9 KiB
PHP
<?php
|
|
|
|
use yii\helpers\Html;
|
|
use yii\widgets\ActiveForm;
|
|
|
|
/**
|
|
* @var yii\web\View $this
|
|
* @var yii\widgets\ActiveForm $form
|
|
* @var \Da\User\Form\SettingsForm $model
|
|
*/
|
|
|
|
$this->title = Yii::t('user', 'Account settings');
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
?>
|
|
|
|
<?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
|
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<?= $this->render('_menu') ?>
|
|
</div>
|
|
<div class="col-md-9">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<?php $form = ActiveForm::begin([
|
|
'id' => $model->formName(),
|
|
'options' => ['class' => 'form-horizontal'],
|
|
'fieldConfig' => [
|
|
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
|
|
'labelOptions' => ['class' => 'col-lg-3 control-label'],
|
|
],
|
|
'enableAjaxValidation' => true,
|
|
'enableClientValidation' => false,
|
|
]); ?>
|
|
|
|
<?= $form->field($model, 'email') ?>
|
|
|
|
<?= $form->field($model, 'username') ?>
|
|
|
|
<?= $form->field($model, 'new_password')->passwordInput() ?>
|
|
|
|
<hr />
|
|
|
|
<?= $form->field($model, 'current_password')->passwordInput() ?>
|
|
|
|
<div class="form-group">
|
|
<div class="col-lg-offset-3 col-lg-9">
|
|
<?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?><br>
|
|
</div>
|
|
</div>
|
|
|
|
<?php ActiveForm::end(); ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($model->module->allowAccountDelete): ?>
|
|
<div class="panel panel-danger">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><?= Yii::t('user', 'Delete account') ?></h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<p>
|
|
<?= Yii::t('user', 'Once you delete your account, there is no going back') ?>.
|
|
<?= Yii::t('user', 'It will be deleted forever') ?>.
|
|
<?= Yii::t('user', 'Please be certain') ?>.
|
|
</p>
|
|
<?= Html::a(Yii::t('user', 'Delete account'), ['delete'], [
|
|
'class' => 'btn btn-danger',
|
|
'data-method' => 'post',
|
|
'data-confirm' => Yii::t('user', 'Are you sure? There is no going back'),
|
|
]) ?>
|
|
</div>
|
|
</div>
|
|
<?php endif ?>
|
|
</div>
|
|
</div>
|