You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.1 KiB

<?php
3 years ago
use core\entities\user\User;
use core\forms\user\ProfileEditForm;
use kartik\widgets\FileInput;
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
3 years ago
/* @var $this yii\web\View */
/* @var $model ProfileEditForm */
/* @var $user User */
$this->title = Yii::t('user', 'Profile: {username}', ['username' => $user->username]);
$this->params['breadcrumbs'][] = ['label' => $user->username, 'url' => ['view', 'id' => $user->id]];
$this->params['breadcrumbs'][] = Yii::t('user', 'Profile');
?>
<div class="user-profile">
<?php $form = ActiveForm::begin(); ?>
<div class="row">
3 years ago
<div class="col-md-4">
<div class="card">
<div class="card-body">
<div style="text-align: center">
<img style="width: 300px" src="<?= Yii::$app->avatar->show(Yii::$app->user->identity->user->username, null, null, Yii::$app->user->identity->user->user_pic) ?>?<?= rand(10, 5000) ?>" class="img-circle" alt="<?= Yii::$app->user->identity->user->username ?>"/>
</div>
<!-- < ?= $form->field($model, 'user_pic')->fileInput() ?> -->
3 years ago
<?= $form->field($model, 'user_pic')->widget(FileInput::class, [
'options' => [
'accept' => 'image/*'
],
'pluginOptions' => [
'showPreview' => false,
'showCaption' => true,
'showRemove' => true,
3 years ago
'showUpload' => false,
],
]); ?>
</div>
</div>
</div>
3 years ago
<div class="col-md-8">
<div class="card">
<div class="card-body">
<?= $form->field($model, 'username')->textInput(['maxLength' => true]) ?>
<?= $form->field($model, 'email')->textInput(['maxLength' => true]) ?>
<?= $form->field($model, 'password')->passwordInput(['maxLength' => true]) ?>
<?= $form->field($model, 'backend_language')->dropDownList(Yii::$app->params['backendTranslatedLanguages'], [
'value' => Yii::$app->user->identity->user->backend_language ?: Yii::$app->params['backendDefaultLanguage'],
]) ?>
</div>
</div>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('buttons', 'Save'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>