update folder location
This commit is contained in:
48
src/User/resources/views/role/_form.php
Normal file
48
src/User/resources/views/role/_form.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var $this yii\web\View
|
||||
* @var $model \Da\User\Model\Role
|
||||
*/
|
||||
|
||||
use Da\User\Helper\AuthHelper;
|
||||
use dosamigos\selectize\SelectizeDropDownList;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
$unassignedItems = Yii::$container->get(AuthHelper::class)->getUnassignedItems($model);
|
||||
?>
|
||||
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'enableClientValidation' => false,
|
||||
'enableAjaxValidation' => true,
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'description') ?>
|
||||
|
||||
<?= $form->field($model, 'rule') ?>
|
||||
|
||||
<?= $form->field($model, 'children')->widget(SelectizeDropDownList::class, [
|
||||
'items' => $unassignedItems,
|
||||
'options' => [
|
||||
'id' => 'children',
|
||||
'multiple' => true,
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>
|
||||
|
||||
<?php ActiveForm::end() ?>
|
||||
32
src/User/resources/views/role/create.php
Normal file
32
src/User/resources/views/role/create.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var \Da\User\Model\Role
|
||||
* @var $this yii\web\View
|
||||
* @var $unassignedItems string[]
|
||||
*/
|
||||
$this->title = Yii::t('usuario', 'Create new role');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'_form',
|
||||
[
|
||||
'model' => $model,
|
||||
'unassignedItems' => $unassignedItems,
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
70
src/User/resources/views/role/index.php
Normal file
70
src/User/resources/views/role/index.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/*
|
||||
* @var $dataProvider array
|
||||
* @var $searchModel \Da\User\Search\RoleSearch
|
||||
* @var $this yii\web\View
|
||||
*/
|
||||
|
||||
$this->title = Yii::t('usuario', 'Roles');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
|
||||
<?= GridView::widget(
|
||||
[
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'layout' => "{items}\n{pager}",
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'name',
|
||||
'header' => Yii::t('usuario', 'Name'),
|
||||
'options' => [
|
||||
'style' => 'width: 20%',
|
||||
],
|
||||
],
|
||||
[
|
||||
'attribute' => 'description',
|
||||
'header' => Yii::t('usuario', 'Description'),
|
||||
'options' => [
|
||||
'style' => 'width: 55%',
|
||||
],
|
||||
],
|
||||
[
|
||||
'attribute' => 'rule_name',
|
||||
'header' => Yii::t('usuario', 'Rule name'),
|
||||
'options' => [
|
||||
'style' => 'width: 20%',
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'template' => '{update} {delete}',
|
||||
'urlCreator' => function ($action, $model) {
|
||||
return Url::to(['/user/role/'.$action, 'name' => $model['name']]);
|
||||
},
|
||||
'options' => [
|
||||
'style' => 'width: 5%',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
32
src/User/resources/views/role/update.php
Normal file
32
src/User/resources/views/role/update.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var \Da\User\Model\Role
|
||||
* @var $this yii\web\View
|
||||
* @var $unassignedItems string[]
|
||||
*/
|
||||
$this->title = Yii::t('usuario', 'Update role');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
|
||||
<?= $this->render(
|
||||
'_form',
|
||||
[
|
||||
'model' => $model,
|
||||
'unassignedItems' => $unassignedItems,
|
||||
]
|
||||
) ?>
|
||||
|
||||
<?php $this->endContent() ?>
|
||||
Reference in New Issue
Block a user