|
|
|
<?php
|
|
|
|
|
|
|
|
use core\entities\user\User;
|
|
|
|
use core\helpers\UserHelper;
|
|
|
|
use yii\helpers\ArrayHelper;
|
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\DetailView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $model User */
|
|
|
|
|
|
|
|
$this->title = $model->username;
|
|
|
|
$this->params['breadcrumbs'][] = ['label' => 'Users', 'url' => ['index']];
|
|
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
|
|
?>
|
|
|
|
<div class="user-view">
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<?= Html::a(Yii::t('user', 'Users'), ['index'], ['class' => 'btn btn-outline-primary btn-sm']) ?>
|
|
|
|
<?= Html::a(Yii::t('buttons', 'Edit'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary btn-sm']) ?>
|
|
|
|
<?= Html::a(Yii::t('buttons', 'Delete'), ['delete', 'id' => $model->id], [
|
|
|
|
'class' => 'btn btn-danger btn-sm',
|
|
|
|
'data' => [
|
|
|
|
'confirm' => Yii::t('buttons', 'Are you sure you want to delete this item?'),
|
|
|
|
'method' => 'post',
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<?= DetailView::widget([
|
|
|
|
'model' => $model,
|
|
|
|
'attributes' => [
|
|
|
|
'id',
|
|
|
|
'username',
|
|
|
|
'email:email',
|
|
|
|
[
|
|
|
|
'attribute' => 'status',
|
|
|
|
'value' => UserHelper::statusLabel($model->status),
|
|
|
|
'format' => 'raw',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'label' => Yii::t('user', 'Role'),
|
|
|
|
'value' => implode(', ', ArrayHelper::getColumn(Yii::$app->authManager->getRolesByUser($model->id), 'description')),
|
|
|
|
'format' => 'raw',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'attribute' => 'created_at',
|
|
|
|
'format' => ['datetime', 'php:d.m.Y H:i'],
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'attribute' => 'updated_at',
|
|
|
|
'format' => ['datetime', 'php:d.m.Y H:i'],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]) ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|