-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #538 from TonisOrmisson/v2-docs-migration-1
V2. Keep old bootstrap 3 view files included in separate folder, add mailViewsPath
- Loading branch information
Showing
98 changed files
with
3,069 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Migrating from v1 to v2 | ||
|
||
|
||
The main change in v2 is decoupling the UI framework from the module base code in order to allow supporting mulitple | ||
UI frameworks simultaneously. Eg bootstrab 3/4/5 or any other ui framework. To be able to do this v2 is not including | ||
the Bootstrap as a required dependency anymore. | ||
|
||
The module includes the view files for both Bootstrap 3 and Bootstrap 5. The default views for v2 are Bootstrap 5, but | ||
either way the bootstrap dependencies must be specified by your project composer.json requirements depending on which | ||
version you choose to use. | ||
|
||
## Using with old Bootstrap 3 | ||
In order to continue with the _old_ Bootstrap 3 views. you need to: | ||
|
||
1. make sure you have the followin packakges included in your composer.json "require" section: | ||
``` | ||
"2amigos/yii2-selectize-widget": "^1.1", | ||
"yiisoft/yii2-bootstrap": "^2.0", | ||
``` | ||
|
||
2. Change the usuario Module 'viewPath' paramater to a folder containing Bootstrap 3 views, eg the included: | ||
`'viewPath' => '@Da/User/resources/views/bootstrap3',` | ||
|
||
## Using with old Bootstrap 5 | ||
1. make sure you have the followin packakges included in your composer.json "require" section: | ||
``` | ||
"yiisoft/yii2-bootstrap5", | ||
"kartik-v/yii2-widget-select", | ||
"twbs/bootstrap-icons", | ||
``` | ||
2. The default 'viewPath' for v2 Module is Bootstrap 5 views in '@Da/User/resources/views/bootstrap5'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?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\bootstrap\ActiveForm; | ||
use yii\helpers\Html; | ||
|
||
/** @var yii\web\View $this */ | ||
/** @var Da\User\Model\User $user */ | ||
/** @var \Da\User\Module $module */ | ||
|
||
?> | ||
|
||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> | ||
|
||
<?php $form = ActiveForm::begin( | ||
[ | ||
'layout' => 'horizontal', | ||
'enableAjaxValidation' => true, | ||
'enableClientValidation' => false, | ||
'fieldConfig' => [ | ||
'horizontalCssClasses' => [ | ||
'wrapper' => 'col-sm-9', | ||
], | ||
], | ||
] | ||
); ?> | ||
|
||
<?= $this->render('/admin/_user', ['form' => $form, 'user' => $user]) ?> | ||
|
||
<div class="form-group"> | ||
<div class="col-lg-offset-3 col-lg-9"> | ||
<?= Html::submitButton(Yii::t('usuario', 'Update'), ['class' => 'btn btn-block btn-success']) ?> | ||
</div> | ||
</div> | ||
|
||
<?php ActiveForm::end(); ?> | ||
|
||
<?php $this->endContent() ?> |
34 changes: 34 additions & 0 deletions
34
src/User/resources/views/bootstrap3/admin/_assignments.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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 Da\User\Widget\AssignmentsWidget; | ||
|
||
/** @var yii\web\View $this */ | ||
/** @var Da\User\Model\User $user */ | ||
/** @var string[] $params */ | ||
/** @var \Da\User\Module $module */ | ||
|
||
?> | ||
|
||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> | ||
|
||
<?= yii\bootstrap\Alert::widget( | ||
[ | ||
'options' => [ | ||
'class' => 'alert-info alert-dismissible', | ||
], | ||
'body' => Yii::t('usuario', 'You can assign multiple roles or permissions to user by using the form below'), | ||
] | ||
) ?> | ||
|
||
<?= AssignmentsWidget::widget(['userId' => $user->id, 'params' => $params]) ?> | ||
|
||
<?php $this->endContent() ?> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?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\bootstrap\ActiveForm; | ||
use yii\helpers\Html; | ||
|
||
/** | ||
* @var yii\web\View $this | ||
* @var \Da\User\Model\User $user | ||
* @var \Da\User\Model\Profile $profile | ||
* @var \Da\User\Module $module | ||
*/ | ||
|
||
?> | ||
|
||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> | ||
|
||
<?php $form = ActiveForm::begin( | ||
[ | ||
'layout' => 'horizontal', | ||
'enableAjaxValidation' => true, | ||
'enableClientValidation' => false, | ||
'fieldConfig' => [ | ||
'horizontalCssClasses' => [ | ||
'wrapper' => 'col-sm-9', | ||
], | ||
], | ||
] | ||
); ?> | ||
|
||
<?= $form->field($profile, 'name') ?> | ||
<?= $form->field($profile, 'public_email') ?> | ||
<?= $form->field($profile, 'website') ?> | ||
<?= $form->field($profile, 'location') ?> | ||
<?= $form->field($profile, 'gravatar_email') ?> | ||
<?= $form->field($profile, 'bio')->textarea() ?> | ||
|
||
|
||
<div class="form-group"> | ||
<div class="col-lg-offset-3 col-lg-9"> | ||
<?= Html::submitButton(Yii::t('usuario', 'Update'), ['class' => 'btn btn-block btn-success']) ?> | ||
</div> | ||
</div> | ||
|
||
<?php ActiveForm::end(); ?> | ||
|
||
<?php $this->endContent() ?> |
70 changes: 70 additions & 0 deletions
70
src/User/resources/views/bootstrap3/admin/_session-history.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 Da\User\Widget\SessionStatusWidget; | ||
use yii\helpers\Html; | ||
use yii\grid\GridView; | ||
use yii\widgets\Pjax; | ||
use Da\User\Model\SessionHistory; | ||
use Da\User\Search\SessionHistorySearch; | ||
use yii\web\View; | ||
use yii\data\ActiveDataProvider; | ||
|
||
/** | ||
* @var View $this | ||
* @var SessionHistorySearch $searchModel | ||
* @var ActiveDataProvider $dataProvider | ||
* @var \Da\User\Model\User $user | ||
* @var \Da\User\Module $module | ||
*/ | ||
?> | ||
|
||
<?php $this->beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<?= Html::a( | ||
Yii::t('usuario', 'Terminate all sessions'), | ||
['/user/admin/terminate-sessions', 'id' => $user->id], | ||
[ | ||
'class' => 'btn btn-danger btn-xs pull-right', | ||
'data-method' => 'post' | ||
] | ||
) ?> | ||
</div> | ||
</div> | ||
<hr> | ||
|
||
<?php Pjax::begin(); ?> | ||
|
||
<?= GridView::widget([ | ||
'dataProvider' => $dataProvider, | ||
'filterModel' => $searchModel, | ||
'columns' => [ | ||
'user_agent', | ||
'ip', | ||
[ | ||
'contentOptions' => [ | ||
'class' => 'text-nowrap', | ||
], | ||
'label' => Yii::t('usuario', 'Status'), | ||
'value' => function (SessionHistory $model) { | ||
return SessionStatusWidget::widget(['model' => $model]); | ||
}, | ||
], | ||
[ | ||
'attribute' => 'updated_at', | ||
'format' => 'datetime' | ||
], | ||
], | ||
]); ?> | ||
<?php Pjax::end(); ?> | ||
|
||
<?php $this->endContent() ?> |
File renamed without changes.
Oops, something went wrong.