From 389f8eb4b27d5a83eab49fde79e3dc87d1be80a7 Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:31:51 +0200 Subject: [PATCH 01/11] include the latest bootstrap3 views in the core for easier migration --- docs/guides/migrating-to-v2.md | 31 ++ src/User/Module.php | 2 +- .../views/bootstrap3/admin/_account.php | 46 +++ .../views/bootstrap3/admin/_assignments.php | 34 +++ .../views/{ => bootstrap3}/admin/_info.php | 0 .../views/bootstrap3/admin/_profile.php | 55 ++++ .../bootstrap3/admin/_session-history.php | 70 +++++ .../views/{ => bootstrap3}/admin/_user.php | 0 .../views/bootstrap3/admin/create.php | 119 ++++++++ .../views/bootstrap3/admin/index.php | 198 +++++++++++++ .../views/bootstrap3/admin/update.php | 147 ++++++++++ .../{ => bootstrap3}/mail/confirmation.php | 0 .../{ => bootstrap3}/mail/layouts/html.php | 0 .../{ => bootstrap3}/mail/layouts/text.php | 0 .../{ => bootstrap3}/mail/reconfirmation.php | 0 .../views/{ => bootstrap3}/mail/recovery.php | 0 .../mail/text/confirmation.php | 0 .../mail/text/reconfirmation.php | 0 .../{ => bootstrap3}/mail/text/recovery.php | 0 .../mail/text/twofactorcode.php | 0 .../{ => bootstrap3}/mail/text/welcome.php | 0 .../{ => bootstrap3}/mail/twofactorcode.php | 0 .../views/{ => bootstrap3}/mail/welcome.php | 0 .../views/bootstrap3/permission/_form.php | 57 ++++ .../{ => bootstrap3}/permission/create.php | 0 .../{ => bootstrap3}/permission/index.php | 0 .../{ => bootstrap3}/permission/update.php | 0 .../views/bootstrap3/profile/show.php | 71 +++++ .../views/bootstrap3/recovery/request.php | 47 +++ .../views/bootstrap3/recovery/reset.php | 47 +++ .../views/bootstrap3/registration/connect.php | 65 +++++ .../bootstrap3/registration/register.php | 61 ++++ .../views/bootstrap3/registration/resend.php | 46 +++ .../resources/views/bootstrap3/role/_form.php | 57 ++++ .../views/{ => bootstrap3}/role/create.php | 0 .../views/{ => bootstrap3}/role/index.php | 0 .../views/{ => bootstrap3}/role/update.php | 0 .../resources/views/bootstrap3/rule/_form.php | 27 ++ .../views/{ => bootstrap3}/rule/create.php | 0 .../views/{ => bootstrap3}/rule/index.php | 0 .../views/{ => bootstrap3}/rule/update.php | 0 .../views/bootstrap3/security/confirm.php | 69 +++++ .../views/bootstrap3/security/login.php | 99 +++++++ .../views/bootstrap3/settings/_menu.php | 65 +++++ .../views/bootstrap3/settings/account.php | 275 ++++++++++++++++++ .../bootstrap3/settings/gdpr-consent.php | 35 +++ .../views/bootstrap3/settings/gdpr-delete.php | 60 ++++ .../views/bootstrap3/settings/networks.php | 86 ++++++ .../views/bootstrap3/settings/privacy.php | 71 +++++ .../views/bootstrap3/settings/profile.php | 92 ++++++ .../bootstrap3/settings/session-history.php | 79 +++++ .../settings/two-factor-email.php | 0 .../settings/two-factor-sms.php | 0 .../{ => bootstrap3}/settings/two-factor.php | 0 .../views/bootstrap3/shared/_alert.php | 33 +++ .../views/bootstrap3/shared/_menu.php | 62 ++++ .../views/bootstrap3/shared/admin_layout.php | 39 +++ .../views/{ => bootstrap3}/shared/message.php | 0 .../bootstrap3/widgets/assignments/form.php | 59 ++++ .../views/bootstrap3/widgets/login/form.php | 56 ++++ .../views/{ => bootstrap5}/admin/_account.php | 0 .../{ => bootstrap5}/admin/_assignments.php | 0 .../views/bootstrap5/admin/_info.php | 58 ++++ .../views/{ => bootstrap5}/admin/_profile.php | 0 .../admin/_session-history.php | 0 .../views/bootstrap5/admin/_user.php | 20 ++ .../views/{ => bootstrap5}/admin/create.php | 0 .../views/{ => bootstrap5}/admin/index.php | 0 .../views/{ => bootstrap5}/admin/update.php | 0 .../views/bootstrap5/mail/confirmation.php | 34 +++ .../views/bootstrap5/mail/layouts/html.php | 78 +++++ .../views/bootstrap5/mail/layouts/text.php | 23 ++ .../views/bootstrap5/mail/reconfirmation.php | 37 +++ .../views/bootstrap5/mail/recovery.php | 38 +++ .../bootstrap5/mail/text/confirmation.php | 25 ++ .../bootstrap5/mail/text/reconfirmation.php | 29 ++ .../views/bootstrap5/mail/text/recovery.php | 25 ++ .../bootstrap5/mail/text/twofactorcode.php | 22 ++ .../views/bootstrap5/mail/text/welcome.php | 40 +++ .../views/bootstrap5/mail/twofactorcode.php | 30 ++ .../views/bootstrap5/mail/welcome.php | 52 ++++ .../{ => bootstrap5}/permission/_form.php | 0 .../views/bootstrap5/permission/create.php | 34 +++ .../views/bootstrap5/permission/index.php | 70 +++++ .../views/bootstrap5/permission/update.php | 34 +++ .../views/{ => bootstrap5}/profile/show.php | 0 .../{ => bootstrap5}/recovery/request.php | 0 .../views/{ => bootstrap5}/recovery/reset.php | 0 .../{ => bootstrap5}/registration/connect.php | 0 .../registration/register.php | 0 .../{ => bootstrap5}/registration/resend.php | 0 .../views/{ => bootstrap5}/role/_form.php | 0 .../views/bootstrap5/role/create.php | 33 +++ .../resources/views/bootstrap5/role/index.php | 71 +++++ .../views/bootstrap5/role/update.php | 33 +++ .../views/{ => bootstrap5}/rule/_form.php | 0 .../views/bootstrap5/rule/create.php | 32 ++ .../resources/views/bootstrap5/rule/index.php | 78 +++++ .../views/bootstrap5/rule/update.php | 34 +++ .../{ => bootstrap5}/security/confirm.php | 0 .../views/{ => bootstrap5}/security/login.php | 0 .../views/{ => bootstrap5}/settings/_menu.php | 0 .../{ => bootstrap5}/settings/account.php | 2 +- .../settings/gdpr-consent.php | 0 .../{ => bootstrap5}/settings/gdpr-delete.php | 0 .../{ => bootstrap5}/settings/networks.php | 0 .../{ => bootstrap5}/settings/privacy.php | 0 .../{ => bootstrap5}/settings/profile.php | 0 .../settings/session-history.php | 0 .../bootstrap5/settings/two-factor-email.php | 35 +++ .../bootstrap5/settings/two-factor-sms.php | 68 +++++ .../views/bootstrap5/settings/two-factor.php | 47 +++ .../views/{ => bootstrap5}/shared/_alert.php | 0 .../views/{ => bootstrap5}/shared/_menu.php | 0 .../{ => bootstrap5}/shared/admin_layout.php | 0 .../views/bootstrap5/shared/message.php | 27 ++ .../widgets/assignments/form.php | 0 .../{ => bootstrap5}/widgets/login/form.php | 0 118 files changed, 3467 insertions(+), 2 deletions(-) create mode 100644 docs/guides/migrating-to-v2.md create mode 100644 src/User/resources/views/bootstrap3/admin/_account.php create mode 100644 src/User/resources/views/bootstrap3/admin/_assignments.php rename src/User/resources/views/{ => bootstrap3}/admin/_info.php (100%) create mode 100644 src/User/resources/views/bootstrap3/admin/_profile.php create mode 100755 src/User/resources/views/bootstrap3/admin/_session-history.php rename src/User/resources/views/{ => bootstrap3}/admin/_user.php (100%) create mode 100644 src/User/resources/views/bootstrap3/admin/create.php create mode 100644 src/User/resources/views/bootstrap3/admin/index.php create mode 100755 src/User/resources/views/bootstrap3/admin/update.php rename src/User/resources/views/{ => bootstrap3}/mail/confirmation.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/layouts/html.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/layouts/text.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/reconfirmation.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/recovery.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/text/confirmation.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/text/reconfirmation.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/text/recovery.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/text/twofactorcode.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/text/welcome.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/twofactorcode.php (100%) rename src/User/resources/views/{ => bootstrap3}/mail/welcome.php (100%) create mode 100644 src/User/resources/views/bootstrap3/permission/_form.php rename src/User/resources/views/{ => bootstrap3}/permission/create.php (100%) rename src/User/resources/views/{ => bootstrap3}/permission/index.php (100%) rename src/User/resources/views/{ => bootstrap3}/permission/update.php (100%) create mode 100644 src/User/resources/views/bootstrap3/profile/show.php create mode 100644 src/User/resources/views/bootstrap3/recovery/request.php create mode 100644 src/User/resources/views/bootstrap3/recovery/reset.php create mode 100644 src/User/resources/views/bootstrap3/registration/connect.php create mode 100644 src/User/resources/views/bootstrap3/registration/register.php create mode 100644 src/User/resources/views/bootstrap3/registration/resend.php create mode 100644 src/User/resources/views/bootstrap3/role/_form.php rename src/User/resources/views/{ => bootstrap3}/role/create.php (100%) rename src/User/resources/views/{ => bootstrap3}/role/index.php (100%) rename src/User/resources/views/{ => bootstrap3}/role/update.php (100%) create mode 100644 src/User/resources/views/bootstrap3/rule/_form.php rename src/User/resources/views/{ => bootstrap3}/rule/create.php (100%) rename src/User/resources/views/{ => bootstrap3}/rule/index.php (100%) rename src/User/resources/views/{ => bootstrap3}/rule/update.php (100%) create mode 100644 src/User/resources/views/bootstrap3/security/confirm.php create mode 100644 src/User/resources/views/bootstrap3/security/login.php create mode 100755 src/User/resources/views/bootstrap3/settings/_menu.php create mode 100644 src/User/resources/views/bootstrap3/settings/account.php create mode 100644 src/User/resources/views/bootstrap3/settings/gdpr-consent.php create mode 100644 src/User/resources/views/bootstrap3/settings/gdpr-delete.php create mode 100644 src/User/resources/views/bootstrap3/settings/networks.php create mode 100644 src/User/resources/views/bootstrap3/settings/privacy.php create mode 100644 src/User/resources/views/bootstrap3/settings/profile.php create mode 100755 src/User/resources/views/bootstrap3/settings/session-history.php rename src/User/resources/views/{ => bootstrap3}/settings/two-factor-email.php (100%) rename src/User/resources/views/{ => bootstrap3}/settings/two-factor-sms.php (100%) rename src/User/resources/views/{ => bootstrap3}/settings/two-factor.php (100%) create mode 100644 src/User/resources/views/bootstrap3/shared/_alert.php create mode 100644 src/User/resources/views/bootstrap3/shared/_menu.php create mode 100644 src/User/resources/views/bootstrap3/shared/admin_layout.php rename src/User/resources/views/{ => bootstrap3}/shared/message.php (100%) create mode 100644 src/User/resources/views/bootstrap3/widgets/assignments/form.php create mode 100644 src/User/resources/views/bootstrap3/widgets/login/form.php rename src/User/resources/views/{ => bootstrap5}/admin/_account.php (100%) rename src/User/resources/views/{ => bootstrap5}/admin/_assignments.php (100%) create mode 100644 src/User/resources/views/bootstrap5/admin/_info.php rename src/User/resources/views/{ => bootstrap5}/admin/_profile.php (100%) rename src/User/resources/views/{ => bootstrap5}/admin/_session-history.php (100%) create mode 100644 src/User/resources/views/bootstrap5/admin/_user.php rename src/User/resources/views/{ => bootstrap5}/admin/create.php (100%) rename src/User/resources/views/{ => bootstrap5}/admin/index.php (100%) rename src/User/resources/views/{ => bootstrap5}/admin/update.php (100%) create mode 100644 src/User/resources/views/bootstrap5/mail/confirmation.php create mode 100644 src/User/resources/views/bootstrap5/mail/layouts/html.php create mode 100644 src/User/resources/views/bootstrap5/mail/layouts/text.php create mode 100644 src/User/resources/views/bootstrap5/mail/reconfirmation.php create mode 100644 src/User/resources/views/bootstrap5/mail/recovery.php create mode 100644 src/User/resources/views/bootstrap5/mail/text/confirmation.php create mode 100644 src/User/resources/views/bootstrap5/mail/text/reconfirmation.php create mode 100644 src/User/resources/views/bootstrap5/mail/text/recovery.php create mode 100644 src/User/resources/views/bootstrap5/mail/text/twofactorcode.php create mode 100644 src/User/resources/views/bootstrap5/mail/text/welcome.php create mode 100644 src/User/resources/views/bootstrap5/mail/twofactorcode.php create mode 100644 src/User/resources/views/bootstrap5/mail/welcome.php rename src/User/resources/views/{ => bootstrap5}/permission/_form.php (100%) create mode 100644 src/User/resources/views/bootstrap5/permission/create.php create mode 100644 src/User/resources/views/bootstrap5/permission/index.php create mode 100644 src/User/resources/views/bootstrap5/permission/update.php rename src/User/resources/views/{ => bootstrap5}/profile/show.php (100%) rename src/User/resources/views/{ => bootstrap5}/recovery/request.php (100%) rename src/User/resources/views/{ => bootstrap5}/recovery/reset.php (100%) rename src/User/resources/views/{ => bootstrap5}/registration/connect.php (100%) rename src/User/resources/views/{ => bootstrap5}/registration/register.php (100%) rename src/User/resources/views/{ => bootstrap5}/registration/resend.php (100%) rename src/User/resources/views/{ => bootstrap5}/role/_form.php (100%) create mode 100644 src/User/resources/views/bootstrap5/role/create.php create mode 100644 src/User/resources/views/bootstrap5/role/index.php create mode 100644 src/User/resources/views/bootstrap5/role/update.php rename src/User/resources/views/{ => bootstrap5}/rule/_form.php (100%) create mode 100644 src/User/resources/views/bootstrap5/rule/create.php create mode 100644 src/User/resources/views/bootstrap5/rule/index.php create mode 100644 src/User/resources/views/bootstrap5/rule/update.php rename src/User/resources/views/{ => bootstrap5}/security/confirm.php (100%) rename src/User/resources/views/{ => bootstrap5}/security/login.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/_menu.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/account.php (99%) rename src/User/resources/views/{ => bootstrap5}/settings/gdpr-consent.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/gdpr-delete.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/networks.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/privacy.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/profile.php (100%) rename src/User/resources/views/{ => bootstrap5}/settings/session-history.php (100%) create mode 100644 src/User/resources/views/bootstrap5/settings/two-factor-email.php create mode 100644 src/User/resources/views/bootstrap5/settings/two-factor-sms.php create mode 100644 src/User/resources/views/bootstrap5/settings/two-factor.php rename src/User/resources/views/{ => bootstrap5}/shared/_alert.php (100%) rename src/User/resources/views/{ => bootstrap5}/shared/_menu.php (100%) rename src/User/resources/views/{ => bootstrap5}/shared/admin_layout.php (100%) create mode 100644 src/User/resources/views/bootstrap5/shared/message.php rename src/User/resources/views/{ => bootstrap5}/widgets/assignments/form.php (100%) rename src/User/resources/views/{ => bootstrap5}/widgets/login/form.php (100%) diff --git a/docs/guides/migrating-to-v2.md b/docs/guides/migrating-to-v2.md new file mode 100644 index 00000000..8b2c7dd9 --- /dev/null +++ b/docs/guides/migrating-to-v2.md @@ -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'. diff --git a/src/User/Module.php b/src/User/Module.php index d8b4e03d..d533468a 100755 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -224,7 +224,7 @@ class Module extends BaseModule /** * @var string */ - public $viewPath = '@Da/User/resources/views'; + public $viewPath = '@Da/User/resources/views/bootstrap5'; /** * @var string the session key name to impersonate users. Please, modify it for security reasons! */ diff --git a/src/User/resources/views/bootstrap3/admin/_account.php b/src/User/resources/views/bootstrap3/admin/_account.php new file mode 100644 index 00000000..7b440214 --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/_account.php @@ -0,0 +1,46 @@ + + * + * 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 */ + +?> + +beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> + + 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], + ], + ] +); ?> + +render('/admin/_user', ['form' => $form, 'user' => $user]) ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+ + + +endContent() ?> diff --git a/src/User/resources/views/bootstrap3/admin/_assignments.php b/src/User/resources/views/bootstrap3/admin/_assignments.php new file mode 100644 index 00000000..d2b0a729 --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/_assignments.php @@ -0,0 +1,34 @@ + + * + * 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 */ + +?> + +beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> + + [ + 'class' => 'alert-info alert-dismissible', + ], + 'body' => Yii::t('usuario', 'You can assign multiple roles or permissions to user by using the form below'), + ] +) ?> + + $user->id, 'params' => $params]) ?> + +endContent() ?> diff --git a/src/User/resources/views/admin/_info.php b/src/User/resources/views/bootstrap3/admin/_info.php similarity index 100% rename from src/User/resources/views/admin/_info.php rename to src/User/resources/views/bootstrap3/admin/_info.php diff --git a/src/User/resources/views/bootstrap3/admin/_profile.php b/src/User/resources/views/bootstrap3/admin/_profile.php new file mode 100644 index 00000000..17994bea --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/_profile.php @@ -0,0 +1,55 @@ + + * + * 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 + */ + +?> + +beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> + + 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], + ], + ] +); ?> + +field($profile, 'name') ?> +field($profile, 'public_email') ?> +field($profile, 'website') ?> +field($profile, 'location') ?> +field($profile, 'gravatar_email') ?> +field($profile, 'bio')->textarea() ?> + + +
+
+ 'btn btn-block btn-success']) ?> +
+
+ + + +endContent() ?> diff --git a/src/User/resources/views/bootstrap3/admin/_session-history.php b/src/User/resources/views/bootstrap3/admin/_session-history.php new file mode 100755 index 00000000..df1ad7b2 --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/_session-history.php @@ -0,0 +1,70 @@ + + * + * 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 + */ +?> + +beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> +
+
+ $user->id], + [ + 'class' => 'btn btn-danger btn-xs pull-right', + 'data-method' => 'post' + ] + ) ?> +
+
+
+ + + + $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' + ], + ], +]); ?> + + +endContent() ?> diff --git a/src/User/resources/views/admin/_user.php b/src/User/resources/views/bootstrap3/admin/_user.php similarity index 100% rename from src/User/resources/views/admin/_user.php rename to src/User/resources/views/bootstrap3/admin/_user.php diff --git a/src/User/resources/views/bootstrap3/admin/create.php b/src/User/resources/views/bootstrap3/admin/create.php new file mode 100644 index 00000000..f65d7de1 --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/create.php @@ -0,0 +1,119 @@ + + * + * 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\bootstrap\Nav; +use yii\helpers\Html; + +/** + * @var yii\web\View $this + * @var \Da\User\Model\User $user + */ + +$this->title = Yii::t('usuario', 'Create a user account'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; + +?> +
+render( + '/shared/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> +
+
+
+
+ [ + 'class' => 'nav-pills nav-stacked', + ], + 'items' => [ + [ + 'label' => Yii::t('usuario', 'Account details'), + 'url' => ['/user/admin/create'], + ], + [ + 'label' => Yii::t('usuario', 'Profile details'), + 'options' => [ + 'class' => 'disabled', + 'onclick' => 'return false;', + ], + ], + [ + 'label' => Yii::t('usuario', 'Information'), + 'options' => [ + 'class' => 'disabled', + 'onclick' => 'return false;', + ], + ], + ], + ] + ) ?> +
+
+
+
+
+
+
+ . + . +
+ 'horizontal', + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'fieldConfig' => [ + 'horizontalCssClasses' => [ + 'wrapper' => 'col-sm-9', + ], + ], + ] + ); ?> + + render('/admin/_user', ['form' => $form, 'user' => $user]) ?> + +
+
+ 'btn btn-block btn-success'] + ) ?> +
+
+ + +
+
+
+
+
+
+
+
+ diff --git a/src/User/resources/views/bootstrap3/admin/index.php b/src/User/resources/views/bootstrap3/admin/index.php new file mode 100644 index 00000000..a991fda0 --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/index.php @@ -0,0 +1,198 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\grid\GridView; +use yii\helpers\Html; +use yii\web\View; +use yii\widgets\Pjax; + +/** + * @var yii\web\View $this + * @var yii\data\ActiveDataProvider $dataProvider + * @var Da\User\Search\UserSearch $searchModel + * @var Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Manage users'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + + +
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + 'username', + 'email:email', + [ + 'attribute' => 'registration_ip', + 'value' => function ($model) { + return $model->registration_ip == null + ? '' . Yii::t('usuario', '(not set)') . '' + : $model->registration_ip; + }, + 'format' => 'html', + 'visible' => !$module->disableIpLogging, + ], + [ + 'attribute' => 'created_at', + 'value' => function ($model) { + if (extension_loaded('intl')) { + return Yii::t('usuario', '{0, date, MMM dd, YYYY HH:mm}', [$model->created_at]); + } + + return date('Y-m-d G:i:s', $model->created_at); + }, + ], + [ + 'attribute' => 'last_login_at', + 'value' => function ($model) { + if (!$model->last_login_at || $model->last_login_at == 0) { + return Yii::t('usuario', 'Never'); + } elseif (extension_loaded('intl')) { + return Yii::t('usuario', '{0, date, MMM dd, YYYY HH:mm}', [$model->last_login_at]); + } else { + return date('Y-m-d G:i:s', $model->last_login_at); + } + }, + ], + [ + 'attribute' => 'last_login_ip', + 'value' => function ($model) { + return $model->last_login_ip == null + ? '' . Yii::t('usuario', '(not set)') . '' + : $model->last_login_ip; + }, + 'format' => 'html', + 'visible' => !$module->disableIpLogging, + ], + [ + 'header' => Yii::t('usuario', 'Confirmation'), + 'value' => function ($model) { + if ($model->isConfirmed) { + return '
+ ' . Yii::t('usuario', 'Confirmed') . ' +
'; + } + + return Html::a( + Yii::t('usuario', 'Confirm'), + ['confirm', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-success btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'Are you sure you want to confirm this user?'), + ] + ); + }, + 'format' => 'raw', + 'visible' => Yii::$app->getModule('user')->enableEmailConfirmation, + ], + 'password_age', + [ + 'header' => Yii::t('usuario', 'Block status'), + 'value' => function ($model) { + if ($model->isBlocked) { + return Html::a( + Yii::t('usuario', 'Unblock'), + ['block', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-success btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'Are you sure you want to unblock this user?'), + ] + ); + } + + return Html::a( + Yii::t('usuario', 'Block'), + ['block', 'id' => $model->id], + [ + 'class' => 'btn btn-xs btn-danger btn-block', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'Are you sure you want to block this user?'), + ] + ); + }, + 'format' => 'raw', + ], + [ + 'class' => 'yii\grid\ActionColumn', + 'template' => '{switch} {reset} {force-password-change} {update} {delete}', + 'buttons' => [ + 'switch' => function ($url, $model) use ($module) { + if ($model->id != Yii::$app->user->id && $module->enableSwitchIdentities) { + return Html::a( + '', + ['/user/admin/switch-identity', 'id' => $model->id], + [ + 'title' => Yii::t('usuario', 'Impersonate this user'), + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you want to switch to this user for the rest of this Session?' + ), + 'data-method' => 'POST', + ] + ); + } + + return null; + }, + 'reset' => function ($url, $model) use ($module) { + if($module->allowAdminPasswordRecovery) { + return Html::a( + '', + ['/user/admin/password-reset', 'id' => $model->id], + [ + 'title' => Yii::t('usuario', 'Send password recovery email'), + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you wish to send a password recovery email to this user?' + ), + 'data-method' => 'POST', + ] + ); + } + + return null; + }, + 'force-password-change' => function ($url, $model) use ($module) { + if (is_null($module->maxPasswordAge)) { + return null; + } + return Html::a( + '', + ['/user/admin/force-password-change', 'id' => $model->id], + [ + 'title' => Yii::t('usuario', 'Force password change at next login'), + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you wish the user to change their password at next login?' + ), + 'data-method' => 'POST', + ] + ); + }, + ] + ], + ], + ] +); ?> +
+ + +endContent() ?> diff --git a/src/User/resources/views/bootstrap3/admin/update.php b/src/User/resources/views/bootstrap3/admin/update.php new file mode 100755 index 00000000..a90fd96f --- /dev/null +++ b/src/User/resources/views/bootstrap3/admin/update.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use Da\User\Model\User; +use yii\bootstrap\Nav; +use yii\helpers\Html; +use yii\web\View; +use Da\User\Module as UserModule; + +/** + * @var View $this + * @var User $user + * @var string $content + */ + +$this->title = Yii::t('usuario', 'Update user account'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; + +/** @var UserModule $module */ +$module = Yii::$app->getModule('user'); +?> +
+render( + '/shared/_alert', + [ + 'module' => $module, + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> +
+
+
+
+ [ + 'class' => 'nav-pills nav-stacked', + ], + 'items' => [ + [ + 'label' => Yii::t('usuario', 'Account details'), + 'url' => ['/user/admin/update', 'id' => $user->id], + ], + [ + 'label' => Yii::t('usuario', 'Profile details'), + 'url' => ['/user/admin/update-profile', 'id' => $user->id], + ], + [ + 'label' => Yii::t('usuario', 'Information'), + 'url' => ['/user/admin/info', 'id' => $user->id], + ], + [ + 'label' => Yii::t('usuario', 'Assignments'), + 'url' => ['/user/admin/assignments', 'id' => $user->id], + ], + [ + 'label' => Yii::t('usuario', 'Session history'), + 'url' => ['/user/admin/session-history', 'id' => $user->id], + 'visible' => $module->enableSessionHistory, + ], + '
', + [ + 'label' => Yii::t('usuario', 'Confirm'), + 'url' => ['/user/admin/confirm', 'id' => $user->id], + 'visible' => !$user->isConfirmed, + 'linkOptions' => [ + 'class' => 'text-success', + 'data-method' => 'post', + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you want to confirm this user?' + ), + ], + ], + [ + 'label' => Yii::t('usuario', 'Block'), + 'url' => ['/user/admin/block', 'id' => $user->id], + 'visible' => !$user->isBlocked, + 'linkOptions' => [ + 'class' => 'text-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you want to block this user?' + ), + ], + ], + [ + 'label' => Yii::t('usuario', 'Unblock'), + 'url' => ['/user/admin/block', 'id' => $user->id], + 'visible' => $user->isBlocked, + 'linkOptions' => [ + 'class' => 'text-success', + 'data-method' => 'post', + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you want to unblock this user?' + ), + ], + ], + [ + 'label' => Yii::t('usuario', 'Delete'), + 'url' => ['/user/admin/delete', 'id' => $user->id], + 'linkOptions' => [ + 'class' => 'text-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you want to delete this user?' + ), + ], + ], + ], + ] + ) ?> +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
diff --git a/src/User/resources/views/mail/confirmation.php b/src/User/resources/views/bootstrap3/mail/confirmation.php similarity index 100% rename from src/User/resources/views/mail/confirmation.php rename to src/User/resources/views/bootstrap3/mail/confirmation.php diff --git a/src/User/resources/views/mail/layouts/html.php b/src/User/resources/views/bootstrap3/mail/layouts/html.php similarity index 100% rename from src/User/resources/views/mail/layouts/html.php rename to src/User/resources/views/bootstrap3/mail/layouts/html.php diff --git a/src/User/resources/views/mail/layouts/text.php b/src/User/resources/views/bootstrap3/mail/layouts/text.php similarity index 100% rename from src/User/resources/views/mail/layouts/text.php rename to src/User/resources/views/bootstrap3/mail/layouts/text.php diff --git a/src/User/resources/views/mail/reconfirmation.php b/src/User/resources/views/bootstrap3/mail/reconfirmation.php similarity index 100% rename from src/User/resources/views/mail/reconfirmation.php rename to src/User/resources/views/bootstrap3/mail/reconfirmation.php diff --git a/src/User/resources/views/mail/recovery.php b/src/User/resources/views/bootstrap3/mail/recovery.php similarity index 100% rename from src/User/resources/views/mail/recovery.php rename to src/User/resources/views/bootstrap3/mail/recovery.php diff --git a/src/User/resources/views/mail/text/confirmation.php b/src/User/resources/views/bootstrap3/mail/text/confirmation.php similarity index 100% rename from src/User/resources/views/mail/text/confirmation.php rename to src/User/resources/views/bootstrap3/mail/text/confirmation.php diff --git a/src/User/resources/views/mail/text/reconfirmation.php b/src/User/resources/views/bootstrap3/mail/text/reconfirmation.php similarity index 100% rename from src/User/resources/views/mail/text/reconfirmation.php rename to src/User/resources/views/bootstrap3/mail/text/reconfirmation.php diff --git a/src/User/resources/views/mail/text/recovery.php b/src/User/resources/views/bootstrap3/mail/text/recovery.php similarity index 100% rename from src/User/resources/views/mail/text/recovery.php rename to src/User/resources/views/bootstrap3/mail/text/recovery.php diff --git a/src/User/resources/views/mail/text/twofactorcode.php b/src/User/resources/views/bootstrap3/mail/text/twofactorcode.php similarity index 100% rename from src/User/resources/views/mail/text/twofactorcode.php rename to src/User/resources/views/bootstrap3/mail/text/twofactorcode.php diff --git a/src/User/resources/views/mail/text/welcome.php b/src/User/resources/views/bootstrap3/mail/text/welcome.php similarity index 100% rename from src/User/resources/views/mail/text/welcome.php rename to src/User/resources/views/bootstrap3/mail/text/welcome.php diff --git a/src/User/resources/views/mail/twofactorcode.php b/src/User/resources/views/bootstrap3/mail/twofactorcode.php similarity index 100% rename from src/User/resources/views/mail/twofactorcode.php rename to src/User/resources/views/bootstrap3/mail/twofactorcode.php diff --git a/src/User/resources/views/mail/welcome.php b/src/User/resources/views/bootstrap3/mail/welcome.php similarity index 100% rename from src/User/resources/views/mail/welcome.php rename to src/User/resources/views/bootstrap3/mail/welcome.php diff --git a/src/User/resources/views/bootstrap3/permission/_form.php b/src/User/resources/views/bootstrap3/permission/_form.php new file mode 100644 index 00000000..1ab6575e --- /dev/null +++ b/src/User/resources/views/bootstrap3/permission/_form.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use dosamigos\selectize\SelectizeDropDownList; +use yii\helpers\ArrayHelper; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var Da\User\Model\Permission $model + * @var string[] $unassignedItems + */ + +?> + + false, + 'enableAjaxValidation' => true, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'description') ?> + +field($model, 'rule')->widget(SelectizeDropDownList::class, [ + 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'), + 'options' => [ + 'prompt' => Yii::t('usuario', 'Select rule...'), + ] +]) ?> + + +field($model, 'children')->widget( + SelectizeDropDownList::class, + [ + 'items' => $unassignedItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + 'btn btn-success btn-block']) ?> + + diff --git a/src/User/resources/views/permission/create.php b/src/User/resources/views/bootstrap3/permission/create.php similarity index 100% rename from src/User/resources/views/permission/create.php rename to src/User/resources/views/bootstrap3/permission/create.php diff --git a/src/User/resources/views/permission/index.php b/src/User/resources/views/bootstrap3/permission/index.php similarity index 100% rename from src/User/resources/views/permission/index.php rename to src/User/resources/views/bootstrap3/permission/index.php diff --git a/src/User/resources/views/permission/update.php b/src/User/resources/views/bootstrap3/permission/update.php similarity index 100% rename from src/User/resources/views/permission/update.php rename to src/User/resources/views/bootstrap3/permission/update.php diff --git a/src/User/resources/views/bootstrap3/profile/show.php b/src/User/resources/views/bootstrap3/profile/show.php new file mode 100644 index 00000000..a101a975 --- /dev/null +++ b/src/User/resources/views/bootstrap3/profile/show.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var \yii\web\View $this + * @var \Da\User\Model\Profile $profile + */ + +$this->title = empty($profile->name) ? Html::encode($profile->user->username) : Html::encode($profile->name); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+ getAvatarUrl(230), + [ + 'class' => 'img-rounded img-responsive', + 'alt' => $profile->user->username, + ] + ) ?> +
+
+

title ?>

+
    + location)): ?> +
  • + + location) ?> +
  • + + website)): ?> +
  • + + website), Html::encode($profile->website)) ?> +
  • + + public_email)): ?> +
  • + + public_email), + 'mailto:' . + Html::encode($profile->public_email) + ) + ?> +
  • + +
  • + + user->created_at) ?> +
  • +
+ bio)): ?> +

bio) ?>

+ +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/recovery/request.php b/src/User/resources/views/bootstrap3/recovery/request.php new file mode 100644 index 00000000..6b0b6d71 --- /dev/null +++ b/src/User/resources/views/bootstrap3/recovery/request.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Form\RecoveryForm $model + */ + +$this->title = Yii::t('usuario', 'Recover your password'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + 'btn btn-primary btn-block']) ?>
+ + +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/recovery/reset.php b/src/User/resources/views/bootstrap3/recovery/reset.php new file mode 100644 index 00000000..8f225f1c --- /dev/null +++ b/src/User/resources/views/bootstrap3/recovery/reset.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Form\RecoveryForm $model + */ + +$this->title = Yii::t('usuario', 'Reset your password'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'password')->passwordInput() ?> + + 'btn btn-success btn-block']) ?>
+ + +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/registration/connect.php b/src/User/resources/views/bootstrap3/registration/connect.php new file mode 100644 index 00000000..e6e8a505 --- /dev/null +++ b/src/User/resources/views/bootstrap3/registration/connect.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Model\User $model + * @var \Da\User\Model\SocialNetworkAccount $account + */ + +$this->title = Yii::t('usuario', 'Sign in'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+

title) ?>

+
+
+
+

+ : +

+
+ $model->formName(), + ] + ); ?> + + field($model, 'email') ?> + + field($model, 'username') ?> + + 'btn btn-success btn-block']) ?> + + +
+
+

+ . +

+
+
diff --git a/src/User/resources/views/bootstrap3/registration/register.php b/src/User/resources/views/bootstrap3/registration/register.php new file mode 100644 index 00000000..29d1e753 --- /dev/null +++ b/src/User/resources/views/bootstrap3/registration/register.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var \Da\User\Form\RegistrationForm $model + * @var \Da\User\Model\User $user + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Sign up'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + field($model, 'username') ?> + + generatePasswords === false): ?> + field($model, 'password')->passwordInput() ?> + + + enableGdprCompliance): ?> + field($model, 'gdpr_consent')->checkbox(['value' => 1]) ?> + + + 'btn btn-success btn-block']) ?> + + +
+
+

+ +

+
+
diff --git a/src/User/resources/views/bootstrap3/registration/resend.php b/src/User/resources/views/bootstrap3/registration/resend.php new file mode 100644 index 00000000..b687a1e9 --- /dev/null +++ b/src/User/resources/views/bootstrap3/registration/resend.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var \Da\User\Form\ResendForm $model + */ + +$this->title = Yii::t('usuario', 'Request new confirmation message'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email')->textInput(['autofocus' => true]) ?> + + 'btn btn-primary btn-block']) ?>
+ + +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/role/_form.php b/src/User/resources/views/bootstrap3/role/_form.php new file mode 100644 index 00000000..33eb2e93 --- /dev/null +++ b/src/User/resources/views/bootstrap3/role/_form.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var \Da\User\Model\Role $model + */ + +use Da\User\Helper\AuthHelper; +use dosamigos\selectize\SelectizeDropDownList; +use yii\helpers\ArrayHelper; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +$unassignedItems = Yii::$container->get(AuthHelper::class)->getUnassignedItems($model); +?> + + false, + 'enableAjaxValidation' => true, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'description') ?> + +field($model, 'rule')->widget(SelectizeDropDownList::class, [ + 'items' => ArrayHelper::map(Yii::$app->getAuthManager()->getRules(), 'name', 'name'), + 'options' => [ + 'prompt' => 'Select rule...' + ] +]) ?> + +field($model, 'children')->widget( + SelectizeDropDownList::class, + [ + 'items' => $unassignedItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + 'btn btn-success btn-block']) ?> + + diff --git a/src/User/resources/views/role/create.php b/src/User/resources/views/bootstrap3/role/create.php similarity index 100% rename from src/User/resources/views/role/create.php rename to src/User/resources/views/bootstrap3/role/create.php diff --git a/src/User/resources/views/role/index.php b/src/User/resources/views/bootstrap3/role/index.php similarity index 100% rename from src/User/resources/views/role/index.php rename to src/User/resources/views/bootstrap3/role/index.php diff --git a/src/User/resources/views/role/update.php b/src/User/resources/views/bootstrap3/role/update.php similarity index 100% rename from src/User/resources/views/role/update.php rename to src/User/resources/views/bootstrap3/role/update.php diff --git a/src/User/resources/views/bootstrap3/rule/_form.php b/src/User/resources/views/bootstrap3/rule/_form.php new file mode 100644 index 00000000..498a0a82 --- /dev/null +++ b/src/User/resources/views/bootstrap3/rule/_form.php @@ -0,0 +1,27 @@ + + + + false, + 'enableAjaxValidation' => true, + ] +) ?> + +field($model, 'name') ?> + +field($model, 'className') ?> + + 'btn btn-success btn-block']) ?> + + diff --git a/src/User/resources/views/rule/create.php b/src/User/resources/views/bootstrap3/rule/create.php similarity index 100% rename from src/User/resources/views/rule/create.php rename to src/User/resources/views/bootstrap3/rule/create.php diff --git a/src/User/resources/views/rule/index.php b/src/User/resources/views/bootstrap3/rule/index.php similarity index 100% rename from src/User/resources/views/rule/index.php rename to src/User/resources/views/bootstrap3/rule/index.php diff --git a/src/User/resources/views/rule/update.php b/src/User/resources/views/bootstrap3/rule/update.php similarity index 100% rename from src/User/resources/views/rule/update.php rename to src/User/resources/views/bootstrap3/rule/update.php diff --git a/src/User/resources/views/bootstrap3/security/confirm.php b/src/User/resources/views/bootstrap3/security/confirm.php new file mode 100644 index 00000000..ed064742 --- /dev/null +++ b/src/User/resources/views/bootstrap3/security/confirm.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use Da\User\Widget\ConnectWidget; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var \Da\User\Form\LoginForm $model + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Sign in'); +$this->params['breadcrumbs'][] = $this->title; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + 'validateOnType' => false, + 'validateOnChange' => false, + ] + ) ?> + field( + $model, + 'twoFactorAuthenticationCode', + ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']] + ) ?> +
+
+ 'btn btn-default btn-block', 'tabindex' => '3'] + ) ?> +
+
+ 'btn btn-primary btn-block', 'tabindex' => '3'] + ) ?> +
+
+ +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/security/login.php b/src/User/resources/views/bootstrap3/security/login.php new file mode 100644 index 00000000..8bbc5cef --- /dev/null +++ b/src/User/resources/views/bootstrap3/security/login.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use Da\User\Widget\ConnectWidget; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var \Da\User\Form\LoginForm $model + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Sign in'); +$this->params['breadcrumbs'][] = $this->title; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + 'validateOnType' => false, + 'validateOnChange' => false, + ] + ) ?> + + field( + $model, + 'login', + ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']] + ) ?> + + field( + $model, + 'password', + ['inputOptions' => ['class' => 'form-control', 'tabindex' => '2']] + ) + ->passwordInput() + ->label( + Yii::t('usuario', 'Password') + . ($module->allowPasswordRecovery ? + ' (' . Html::a( + Yii::t('usuario', 'Forgot password?'), + ['/user/recovery/request'], + ['tabindex' => '5'] + ) + . ')' : '') + ) ?> + + field($model, 'rememberMe')->checkbox(['tabindex' => '4']) ?> + + 'btn btn-primary btn-block', 'tabindex' => '3'] + ) ?> + + +
+
+ enableEmailConfirmation): ?> +

+ +

+ + enableRegistration): ?> +

+ +

+ + ['/user/security/auth'], + ] + ) ?> +
+
diff --git a/src/User/resources/views/bootstrap3/settings/_menu.php b/src/User/resources/views/bootstrap3/settings/_menu.php new file mode 100755 index 00000000..bd3c2aff --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/_menu.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\widgets\Menu; +use Da\User\Module as UserModule; +use Da\User\Model\User; + +/** @var User $user */ +$user = Yii::$app->user->identity; +/** @var UserModule $module */ +$module = Yii::$app->getModule('user'); +$networksVisible = count(Yii::$app->authClientCollection->clients) > 0; + +?> + +
+
+

+ profile->getAvatarUrl(24), + [ + 'class' => 'img-rounded', + 'alt' => $user->username, + ] + ) ?> + username ?> +

+
+
+ [ + 'class' => 'nav nav-pills nav-stacked', + ], + 'items' => [ + ['label' => Yii::t('usuario', 'Profile'), 'url' => ['/user/settings/profile']], + ['label' => Yii::t('usuario', 'Account'), 'url' => ['/user/settings/account']], + [ + 'label' => Yii::t('usuario', 'Session history'), + 'url' => ['/user/settings/session-history'], + 'visible' => $module->enableSessionHistory, + ], + ['label' => Yii::t('usuario', 'Privacy'), + 'url' => ['/user/settings/privacy'], + 'visible' => $module->enableGdprCompliance + ], + [ + 'label' => Yii::t('usuario', 'Networks'), + 'url' => ['/user/settings/networks'], + 'visible' => $networksVisible, + ], + ], + ] + ) ?> +
+
diff --git a/src/User/resources/views/bootstrap3/settings/account.php b/src/User/resources/views/bootstrap3/settings/account.php new file mode 100644 index 00000000..71acb076 --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/account.php @@ -0,0 +1,275 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\helpers\Url; +use yii\widgets\ActiveForm; +use dmstr\widgets\Alert; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Form\SettingsForm $model + */ + +$this->title = Yii::t('usuario', 'Account settings'); +$this->params['breadcrumbs'][] = $this->title; + +/** @var \Da\User\Module $module */ +$module = Yii::$app->getModule('user'); +?> +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'options' => ['class' => 'form-horizontal'], + 'fieldConfig' => [ + 'template' => "{label}\n
{input}
\n
{error}\n{hint}
", + 'labelOptions' => ['class' => 'col-lg-3 control-label'], + ], + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + ] + ); ?> + + field($model, 'email') ?> + + field($model, 'username') ?> + + field($model, 'new_password')->passwordInput() ?> + +
+ + field($model, 'current_password')->passwordInput() ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+
+ + +
+
+ enableTwoFactorAuthentication): ?> + +
+
+

+
+
+

+ . +

+ getUser()->auth_tf_enabled): + $validators = $module->twoFactorAuthenticationValidators; + $theFirstFound = false; + $checked = ''; + foreach( $validators as $name => $validator ) { + if($validator[ "enabled" ]){ + // I want to check in the radio field the first validator I get + if(!$theFirstFound){ + $checked = 'checked'; + $theFirstFound = true; + } + $description = $validator[ "description" ]; + ?> +
+ > + +
+ + 'enable_tf_btn', + 'class' => 'btn btn-info', + 'data-toggle' => 'modal', + 'data-target' => '#tfmodal' + ] + ) ?> + +

+ getUser()->auth_tf_type; + $message = ''; + switch ($method) { + case 'email': + $message = Yii::t('usuario', 'The email address set is: "{0}".', [ $model->getUser()->email] ); + break; + case 'sms': + $message = Yii::t('usuario', 'The phone number set is: "{0}".', [ $model->getUser()->auth_tf_mobile_phone]); + break; + } + ?> + +

+
+ $model->getUser()->id], + [ + 'id' => 'disable_tf_btn', + 'class' => 'btn btn-warning ', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'This will disable two factor authentication. Are you sure?'), + ] + ) ?> +
+ +
+
+ + module->allowAccountDelete): ?> +
+
+

+
+
+

+ . + . + . +

+
+ 'btn btn-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'Are you sure? There is no going back'), + ] + ) ?> +
+
+
+ +
+
+enableTwoFactorAuthentication): ?> + + $model->getUser()->id]); + $verify = Url::to(['two-factor-enable', 'id' => $model->getUser()->id]); + $mobilePhoneRegistration = Url::to(['two-factor-mobile-phone', 'id' => $model->getUser()->id]); + $js = <<registerJs($js); + ?> + diff --git a/src/User/resources/views/bootstrap3/settings/gdpr-consent.php b/src/User/resources/views/bootstrap3/settings/gdpr-consent.php new file mode 100644 index 00000000..a7b69ae5 --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/gdpr-consent.php @@ -0,0 +1,35 @@ + + +
+
+ $model->formName(), + ] + ); ?> + + + +
+
diff --git a/src/User/resources/views/bootstrap3/settings/gdpr-delete.php b/src/User/resources/views/bootstrap3/settings/gdpr-delete.php new file mode 100644 index 00000000..2ed34df0 --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/gdpr-delete.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\widgets\ActiveForm; +use yii\helpers\Html; + +/** @var \Da\User\Form\GdprDeleteForm $model */ +?> + +
+
+
+
+

+ +

+
+
+

+

+ +

+
+ +
+
+ field($model, 'password')->passwordInput() ?> +
+
+
+
+ 'btn btn-danger']) ?> +
+
+
+
+
+ 'btn btn-info']) ?> +
+
+ +
+
+
+
+ diff --git a/src/User/resources/views/bootstrap3/settings/networks.php b/src/User/resources/views/bootstrap3/settings/networks.php new file mode 100644 index 00000000..6d7a74da --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/networks.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use Da\User\Widget\ConnectWidget; +use yii\helpers\Html; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Model\User $user + */ + +$this->title = Yii::t('usuario', 'Networks'); +$this->params['breadcrumbs'][] = $this->title; +?> + +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+ title) ?> +
+
+
+

+ .

+
+ ['/user/security/auth'], + 'accounts' => $user->socialNetworkAccounts, + 'autoRender' => false, + 'popupMode' => false, + ] + ) ?> + + getClients() as $client): ?> + + + + + + +
+ 'auth-icon ' . $client->getName()]) ?> + + getTitle() ?> + + isConnected($client) ? + Html::a( + Yii::t('usuario', 'Disconnect'), + $auth->createClientUrl($client), + [ + 'class' => 'btn btn-danger btn-block', + 'data-method' => 'post', + ] + ) : + Html::a( + Yii::t('usuario', 'Connect'), + $auth->createClientUrl($client), + [ + 'class' => 'btn btn-success btn-block', + ] + ) + ?> +
+ +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/privacy.php b/src/User/resources/views/bootstrap3/settings/privacy.php new file mode 100644 index 00000000..bc5765ff --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/privacy.php @@ -0,0 +1,71 @@ +title = Yii::t('usuario', 'Privacy settings'); + +?> + +
+
+ render('_menu') ?> +
+
+
+
+

title) ?>

+
+
+
+
+

+

+

+ 'btn btn-info', + 'target' => '_blank' + ]) + ?> +
+
+

+

+

+ allowAccountDelete): ?> + 'gdpr-del-button', + 'class' => 'btn btn-danger', + 'data-method' => 'post', + 'data-confirm' => Yii::t('usuario', 'Are you sure? There is no going back'), + ] + ) ?> + 'btn btn-danger', + 'id' => 'gdpr-del-button', + + ]) + ?> + +
+
+
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/profile.php b/src/User/resources/views/bootstrap3/settings/profile.php new file mode 100644 index 00000000..0237aa02 --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/profile.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use Da\User\Helper\TimezoneHelper; +use yii\helpers\ArrayHelper; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Model\Profile $model + * @var TimezoneHelper $timezoneHelper + */ + +$this->title = Yii::t('usuario', 'Profile settings'); +$this->params['breadcrumbs'][] = $this->title; +$timezoneHelper = $model->make(TimezoneHelper::class); +?> + +
+ +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('_menu') ?> +
+
+
+
+

title) ?>

+
+
+ $model->formName(), + 'options' => ['class' => 'form-horizontal'], + 'fieldConfig' => [ + 'template' => "{label}\n
{input}
\n
{error}\n{hint}
", + 'labelOptions' => ['class' => 'col-lg-3 control-label'], + ], + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + ] + ); ?> + + field($model, 'name') ?> + + field($model, 'public_email') ?> + + field($model, 'website') ?> + + field($model, 'location') ?> + + field($model, 'timezone') + ->dropDownList(ArrayHelper::map($timezoneHelper->getAll(), 'timezone', 'name')); + ?> + field($model, 'gravatar_email') + ->hint( + Html::a( + Yii::t('usuario', 'Change your avatar at Gravatar.com'), + 'http://gravatar.com', + ['target' => '_blank'] + ) + ) ?> + + field($model, 'bio')->textarea() ?> + +
+
+ 'btn btn-block btn-success']) ?> +
+
+
+ + +
+
+
+
diff --git a/src/User/resources/views/bootstrap3/settings/session-history.php b/src/User/resources/views/bootstrap3/settings/session-history.php new file mode 100755 index 00000000..0c75ec88 --- /dev/null +++ b/src/User/resources/views/bootstrap3/settings/session-history.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +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; +use Da\User\Widget\SessionStatusWidget; + +/** + * @var View $this + * @var SessionHistorySearch $searchModel + * @var ActiveDataProvider $dataProvider + */ + +$this->title = Yii::t('usuario', 'Session history'); +$this->params['breadcrumbs'][] = $this->title; +?> + +render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> + +
+
+ render('/settings/_menu') ?> +
+
+
+
+ title) ?> + 'btn btn-danger btn-xs pull-right', + 'data-method' => 'post' + ] + ) ?> +
+
+ + + + $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' + ], + ], + ]); ?> + +
+
+
+
diff --git a/src/User/resources/views/settings/two-factor-email.php b/src/User/resources/views/bootstrap3/settings/two-factor-email.php similarity index 100% rename from src/User/resources/views/settings/two-factor-email.php rename to src/User/resources/views/bootstrap3/settings/two-factor-email.php diff --git a/src/User/resources/views/settings/two-factor-sms.php b/src/User/resources/views/bootstrap3/settings/two-factor-sms.php similarity index 100% rename from src/User/resources/views/settings/two-factor-sms.php rename to src/User/resources/views/bootstrap3/settings/two-factor-sms.php diff --git a/src/User/resources/views/settings/two-factor.php b/src/User/resources/views/bootstrap3/settings/two-factor.php similarity index 100% rename from src/User/resources/views/settings/two-factor.php rename to src/User/resources/views/bootstrap3/settings/two-factor.php diff --git a/src/User/resources/views/bootstrap3/shared/_alert.php b/src/User/resources/views/bootstrap3/shared/_alert.php new file mode 100644 index 00000000..500385f0 --- /dev/null +++ b/src/User/resources/views/bootstrap3/shared/_alert.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\bootstrap\Alert; + +/** @var \Da\User\Module $module */ + +?> + +enableFlashMessages): ?> +
+
+ session->getAllFlashes(true) as $type => $message): ?> + + ['class' => 'alert-dismissible alert-' . $type], + 'body' => $message, + ] + ) ?> + + +
+
+ diff --git a/src/User/resources/views/bootstrap3/shared/_menu.php b/src/User/resources/views/bootstrap3/shared/_menu.php new file mode 100644 index 00000000..af7d660f --- /dev/null +++ b/src/User/resources/views/bootstrap3/shared/_menu.php @@ -0,0 +1,62 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\bootstrap\Nav; + +?> + + [ + 'class' => 'nav-tabs', + 'style' => 'margin-bottom: 15px', + ], + 'items' => [ + [ + 'label' => Yii::t('usuario', 'Users'), + 'url' => ['/user/admin/index'], + ], + [ + 'label' => Yii::t('usuario', 'Roles'), + 'url' => ['/user/role/index'], + ], + [ + 'label' => Yii::t('usuario', 'Permissions'), + 'url' => ['/user/permission/index'], + ], + [ + 'label' => Yii::t('usuario', 'Rules'), + 'url' => ['/user/rule/index'], + ], + [ + 'label' => Yii::t('usuario', 'Create'), + 'items' => [ + [ + 'label' => Yii::t('usuario', 'New user'), + 'url' => ['/user/admin/create'], + ], + [ + 'label' => Yii::t('usuario', 'New role'), + 'url' => ['/user/role/create'], + ], + [ + 'label' => Yii::t('usuario', 'New permission'), + 'url' => ['/user/permission/create'], + ], + [ + 'label' => Yii::t('usuario', 'New rule'), + 'url' => ['/user/rule/create'], + ], + ], + ], + ], + ] +) ?> diff --git a/src/User/resources/views/bootstrap3/shared/admin_layout.php b/src/User/resources/views/bootstrap3/shared/admin_layout.php new file mode 100644 index 00000000..1716356e --- /dev/null +++ b/src/User/resources/views/bootstrap3/shared/admin_layout.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** @var \yii\web\View $this */ +/** @var string $content */ + +?> +
+ +render( + '/shared/_alert', + [ + 'module' => Yii::$app->getModule('user'), + ] +) ?> + +
+
+
+
+

title) ?>

+
+
+ render('/shared/_menu') ?> + +
+
+
+
diff --git a/src/User/resources/views/shared/message.php b/src/User/resources/views/bootstrap3/shared/message.php similarity index 100% rename from src/User/resources/views/shared/message.php rename to src/User/resources/views/bootstrap3/shared/message.php diff --git a/src/User/resources/views/bootstrap3/widgets/assignments/form.php b/src/User/resources/views/bootstrap3/widgets/assignments/form.php new file mode 100644 index 00000000..0fa55a03 --- /dev/null +++ b/src/User/resources/views/bootstrap3/widgets/assignments/form.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use dosamigos\selectize\SelectizeDropDownList; +use yii\bootstrap\Alert; +use yii\helpers\Html; +use yii\widgets\ActiveForm; + +/** @var \yii\web\View $this */ +/** @var string[] $availableItems */ +/** @var Da\User\Model\Assignment $model */ + + +?> + +updated): ?> + + [ + 'class' => 'alert-success', + ], + 'body' => Yii::t('usuario', 'Assignments have been updated'), + ] + ) ?> + + + + false, + 'enableAjaxValidation' => false, + ] +) ?> + + + +field($model, 'items')->widget( + SelectizeDropDownList::class, + [ + 'items' => $availableItems, + 'options' => [ + 'id' => 'children', + 'multiple' => true, + ], + ] +) ?> + + 'btn btn-success btn-block']) ?> + + diff --git a/src/User/resources/views/bootstrap3/widgets/login/form.php b/src/User/resources/views/bootstrap3/widgets/login/form.php new file mode 100644 index 00000000..90032da9 --- /dev/null +++ b/src/User/resources/views/bootstrap3/widgets/login/form.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\helpers\Url; +use yii\widgets\ActiveForm; + +/** + * @var yii\web\View $this + * @var yii\widgets\ActiveForm $form + * @var Da\User\Form\LoginForm $model + * @var string $action + */ + +?> + +user->isGuest): ?> + 'login-widget-form', + 'action' => Url::to(['/user/security/login']), + 'enableAjaxValidation' => true, + 'enableClientValidation' => false, + 'validateOnBlur' => false, + 'validateOnType' => false, + 'validateOnChange' => false, + ] + ) ?> + + field($model, 'login')->textInput(['placeholder' => Yii::t('usuario', 'Login')]) ?> + + field($model, 'password')->passwordInput(['placeholder' => Yii::t('usuario', 'Password')]) ?> + + field($model, 'rememberMe')->checkbox() ?> + + 'btn btn-primary btn-block']) ?> + + + + 'btn btn-danger btn-block', + 'data-method' => 'post', + ] + ) ?> + diff --git a/src/User/resources/views/admin/_account.php b/src/User/resources/views/bootstrap5/admin/_account.php similarity index 100% rename from src/User/resources/views/admin/_account.php rename to src/User/resources/views/bootstrap5/admin/_account.php diff --git a/src/User/resources/views/admin/_assignments.php b/src/User/resources/views/bootstrap5/admin/_assignments.php similarity index 100% rename from src/User/resources/views/admin/_assignments.php rename to src/User/resources/views/bootstrap5/admin/_assignments.php diff --git a/src/User/resources/views/bootstrap5/admin/_info.php b/src/User/resources/views/bootstrap5/admin/_info.php new file mode 100644 index 00000000..a2de1439 --- /dev/null +++ b/src/User/resources/views/bootstrap5/admin/_info.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** @var yii\web\View $this */ +/** @var Da\User\Model\User $user */ +/** @var \Da\User\Module $module */ + +?> + +beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?> + + + + + + + registration_ip !== null): ?> + + + + + + + + isConfirmed): ?> + + + + + + + + isBlocked): ?> + + + + + +
:created_at]) ?>
:registration_ip ?>
:confirmed_at] + ) ?>
:blocked_at] + ) ?> +
+ +endContent() ?> diff --git a/src/User/resources/views/admin/_profile.php b/src/User/resources/views/bootstrap5/admin/_profile.php similarity index 100% rename from src/User/resources/views/admin/_profile.php rename to src/User/resources/views/bootstrap5/admin/_profile.php diff --git a/src/User/resources/views/admin/_session-history.php b/src/User/resources/views/bootstrap5/admin/_session-history.php similarity index 100% rename from src/User/resources/views/admin/_session-history.php rename to src/User/resources/views/bootstrap5/admin/_session-history.php diff --git a/src/User/resources/views/bootstrap5/admin/_user.php b/src/User/resources/views/bootstrap5/admin/_user.php new file mode 100644 index 00000000..5e7303e5 --- /dev/null +++ b/src/User/resources/views/bootstrap5/admin/_user.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\widgets\ActiveForm $form + * @var \Da\User\Model\User $user + */ +?> + +field($user, 'email')->textInput(['maxlength' => 255]) ?> +field($user, 'username')->textInput(['maxlength' => 255]) ?> +field($user, 'password')->passwordInput() ?> diff --git a/src/User/resources/views/admin/create.php b/src/User/resources/views/bootstrap5/admin/create.php similarity index 100% rename from src/User/resources/views/admin/create.php rename to src/User/resources/views/bootstrap5/admin/create.php diff --git a/src/User/resources/views/admin/index.php b/src/User/resources/views/bootstrap5/admin/index.php similarity index 100% rename from src/User/resources/views/admin/index.php rename to src/User/resources/views/bootstrap5/admin/index.php diff --git a/src/User/resources/views/admin/update.php b/src/User/resources/views/bootstrap5/admin/update.php similarity index 100% rename from src/User/resources/views/admin/update.php rename to src/User/resources/views/bootstrap5/admin/update.php diff --git a/src/User/resources/views/bootstrap5/mail/confirmation.php b/src/User/resources/views/bootstrap5/mail/confirmation.php new file mode 100644 index 00000000..20eb842d --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/confirmation.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var \Da\User\Model\User $user + * @var \Da\User\Model\Token $token + */ +?> +

+ , +

+

+ name) ?>. + . +

+

+ url), $token->url) ?> +

+

+ . +

+

+ Yii::$app->name]) ?>. +

diff --git a/src/User/resources/views/bootstrap5/mail/layouts/html.php b/src/User/resources/views/bootstrap5/mail/layouts/html.php new file mode 100644 index 00000000..96ba8066 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/layouts/html.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \yii\web\View $this + * @var string $content + */ +?> +beginPage() ?> + + + + + + head() ?> + + + + + + + + +
+
+ + + + +
+ beginBody() ?> + + endBody() ?> +
+
+
+ + + + + + + + + +endPage() ?> diff --git a/src/User/resources/views/bootstrap5/mail/layouts/text.php b/src/User/resources/views/bootstrap5/mail/layouts/text.php new file mode 100644 index 00000000..d5c064bd --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/layouts/text.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** +/** + * @var \yii\web\View $this + * @var string $content + */ +?> + +beginPage() ?> +beginBody() ?> + +endBody() ?> +endPage() ?> diff --git a/src/User/resources/views/bootstrap5/mail/reconfirmation.php b/src/User/resources/views/bootstrap5/mail/reconfirmation.php new file mode 100644 index 00000000..f41e543c --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/reconfirmation.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var \Da\User\Model\Token $token + */ +?> +

+ , +

+

+ name + ) ?>. + . +

+

+ getUrl()), $token->getUrl()); ?> +

+

+ . +

+

+ . +

diff --git a/src/User/resources/views/bootstrap5/mail/recovery.php b/src/User/resources/views/bootstrap5/mail/recovery.php new file mode 100644 index 00000000..c06e2761 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/recovery.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var \Da\User\Model\User $user + * @var \Da\User\Model\Token $token + */ +?> +

+ , +

+

+ name + ) ?>. + . +

+

+ url), $token->url); ?> +

+

+ . +

+

+ . +

diff --git a/src/User/resources/views/bootstrap5/mail/text/confirmation.php b/src/User/resources/views/bootstrap5/mail/text/confirmation.php new file mode 100644 index 00000000..20a6928c --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/text/confirmation.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \Da\User\Model\Token $token + */ +?> +, + +name) ?>. +. + +url ?> + +. + + Yii::$app->name]) ?>. diff --git a/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php b/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php new file mode 100644 index 00000000..808139c7 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \Da\User\Model\Token $token + */ +?> +, + +name +) ?>. +. + +url ?> + +. + +. diff --git a/src/User/resources/views/bootstrap5/mail/text/recovery.php b/src/User/resources/views/bootstrap5/mail/text/recovery.php new file mode 100644 index 00000000..08a7210d --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/text/recovery.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \Da\User\Model\Token $token + */ +?> +, + +name) ?>. +. + +url ?> + +. + +. diff --git a/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php b/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php new file mode 100644 index 00000000..17255661 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var String $code + */ +?> +, + +: + + + +. diff --git a/src/User/resources/views/bootstrap5/mail/text/welcome.php b/src/User/resources/views/bootstrap5/mail/text/welcome.php new file mode 100644 index 00000000..0d4516b3 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/text/welcome.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \Da\User\Model\User $user + * @var \Da\User\Model\Token $token + * @var \Da\User\Module $module + * @var bool $showPassword + */ + +use yii\helpers\Url; + +?> +, + +name) ?>. +generatePasswords): ?> + : + password ?> + +allowPasswordRecovery): ?> + : + + + + + . + url ?> + . + + + Yii::$app->name]) ?>. diff --git a/src/User/resources/views/bootstrap5/mail/twofactorcode.php b/src/User/resources/views/bootstrap5/mail/twofactorcode.php new file mode 100644 index 00000000..210f84c2 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/twofactorcode.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var String $code + * @var \Da\User\Model\Token $token + */ +?> +

+ , +

+

+ : +

+

+ +

+

+ . +

diff --git a/src/User/resources/views/bootstrap5/mail/welcome.php b/src/User/resources/views/bootstrap5/mail/welcome.php new file mode 100644 index 00000000..8efa10a9 --- /dev/null +++ b/src/User/resources/views/bootstrap5/mail/welcome.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; +use yii\helpers\Url; + +/** + * @var \Da\User\Module $module + * @var \Da\User\Model\User $user + * @var \Da\User\Model\Token $token + * @var bool $showPassword + */ + +?> +

+ , +

+ +

+ name) ?>. + generatePasswords): ?> + : password) ?> + + allowPasswordRecovery): ?> + : + + +

+ + +

+ . +

+

+ url), $token->url); ?> +

+

+ . +

+ + +

+ Yii::$app->name]) ?>. +

diff --git a/src/User/resources/views/permission/_form.php b/src/User/resources/views/bootstrap5/permission/_form.php similarity index 100% rename from src/User/resources/views/permission/_form.php rename to src/User/resources/views/bootstrap5/permission/_form.php diff --git a/src/User/resources/views/bootstrap5/permission/create.php b/src/User/resources/views/bootstrap5/permission/create.php new file mode 100644 index 00000000..8cc02365 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/create.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var Da\User\Model\Permission $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Create new permission'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/permission/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/permission/index.php b/src/User/resources/views/bootstrap5/permission/index.php new file mode 100644 index 00000000..65142bf9 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/index.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var \yii\data\ActiveDataProvider $dataProvider + * @var yii\web\View $this + * @var \Da\User\Search\PermissionSearch $searchModel + * @var \Da\User\Module $module + */ +use yii\grid\ActionColumn; +use yii\grid\GridView; +use yii\helpers\Url; + +$this->title = Yii::t('usuario', 'Permissions'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $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::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/permission/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%', + ], + ], + ], + ] +) ?> +
+endContent() ?> diff --git a/src/User/resources/views/bootstrap5/permission/update.php b/src/User/resources/views/bootstrap5/permission/update.php new file mode 100644 index 00000000..7b1ab449 --- /dev/null +++ b/src/User/resources/views/bootstrap5/permission/update.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var Da\User\Model\Permission $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Update permission'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/permission/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/profile/show.php b/src/User/resources/views/bootstrap5/profile/show.php similarity index 100% rename from src/User/resources/views/profile/show.php rename to src/User/resources/views/bootstrap5/profile/show.php diff --git a/src/User/resources/views/recovery/request.php b/src/User/resources/views/bootstrap5/recovery/request.php similarity index 100% rename from src/User/resources/views/recovery/request.php rename to src/User/resources/views/bootstrap5/recovery/request.php diff --git a/src/User/resources/views/recovery/reset.php b/src/User/resources/views/bootstrap5/recovery/reset.php similarity index 100% rename from src/User/resources/views/recovery/reset.php rename to src/User/resources/views/bootstrap5/recovery/reset.php diff --git a/src/User/resources/views/registration/connect.php b/src/User/resources/views/bootstrap5/registration/connect.php similarity index 100% rename from src/User/resources/views/registration/connect.php rename to src/User/resources/views/bootstrap5/registration/connect.php diff --git a/src/User/resources/views/registration/register.php b/src/User/resources/views/bootstrap5/registration/register.php similarity index 100% rename from src/User/resources/views/registration/register.php rename to src/User/resources/views/bootstrap5/registration/register.php diff --git a/src/User/resources/views/registration/resend.php b/src/User/resources/views/bootstrap5/registration/resend.php similarity index 100% rename from src/User/resources/views/registration/resend.php rename to src/User/resources/views/bootstrap5/registration/resend.php diff --git a/src/User/resources/views/role/_form.php b/src/User/resources/views/bootstrap5/role/_form.php similarity index 100% rename from src/User/resources/views/role/_form.php rename to src/User/resources/views/bootstrap5/role/_form.php diff --git a/src/User/resources/views/bootstrap5/role/create.php b/src/User/resources/views/bootstrap5/role/create.php new file mode 100644 index 00000000..a8210366 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/create.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var \Da\User\Model\Role $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Create new role'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/role/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/role/index.php b/src/User/resources/views/bootstrap5/role/index.php new file mode 100644 index 00000000..5a7beb63 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/index.php @@ -0,0 +1,71 @@ + + * + * 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 \yii\data\DataProviderInterface $dataProvider + * @var \Da\User\Search\RoleSearch $searchModel + * @var yii\web\View $this + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Roles'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $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::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/role/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%', + ], + ], + ], + ] +) ?> +
+endContent() ?> diff --git a/src/User/resources/views/bootstrap5/role/update.php b/src/User/resources/views/bootstrap5/role/update.php new file mode 100644 index 00000000..b5121c96 --- /dev/null +++ b/src/User/resources/views/bootstrap5/role/update.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var \Da\User\Model\Role $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Update role'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/role/_form', + [ + 'model' => $model, + 'unassignedItems' => $unassignedItems, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/rule/_form.php b/src/User/resources/views/bootstrap5/rule/_form.php similarity index 100% rename from src/User/resources/views/rule/_form.php rename to src/User/resources/views/bootstrap5/rule/_form.php diff --git a/src/User/resources/views/bootstrap5/rule/create.php b/src/User/resources/views/bootstrap5/rule/create.php new file mode 100644 index 00000000..a03f96c5 --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/create.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var \Da\User\Model\Rule $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ +$this->title = Yii::t('usuario', 'Create new rule'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/rule/_form', + [ + 'model' => $model, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/rule/index.php b/src/User/resources/views/bootstrap5/rule/index.php new file mode 100644 index 00000000..b2fd066a --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/index.php @@ -0,0 +1,78 @@ +title = Yii::t('usuario', 'Rules'); +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> +
+ $dataProvider, + 'filterModel' => $searchModel, + 'layout' => "{items}\n{pager}", + 'columns' => [ + [ + 'attribute' => 'name', + 'label' => Yii::t('usuario', 'Name'), + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'className', + 'label' => Yii::t('usuario', 'Class'), + 'value' => function ($row) { + $rule = unserialize($row['data']); + + return get_class($rule); + }, + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'created_at', + 'label' => Yii::t('usuario', 'Created at'), + 'format' => 'datetime', + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'attribute' => 'updated_at', + 'label' => Yii::t('usuario', 'Updated at'), + 'format' => 'datetime', + 'options' => [ + 'style' => 'width: 20%' + ], + ], + [ + 'class' => ActionColumn::class, + 'template' => '{update} {delete}', + 'urlCreator' => function ($action, $model) { + return Url::to(['/user/rule/' . $action, 'name' => $model['name']]); + }, + 'options' => [ + 'style' => 'width: 5%' + ], + ] + ], + ] +) ?> +
+ +endContent() ?> diff --git a/src/User/resources/views/bootstrap5/rule/update.php b/src/User/resources/views/bootstrap5/rule/update.php new file mode 100644 index 00000000..53e086a0 --- /dev/null +++ b/src/User/resources/views/bootstrap5/rule/update.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var yii\web\View $this + * @var \Da\User\Model\Rule $model + * @var string[] $unassignedItems + * @var \Da\User\Module $module + */ + +$this->title = Yii::t('usuario', 'Update rule'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Rules'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; + +?> + +beginContent($module->viewPath . '/shared/admin_layout.php') ?> + +render( + '/rule/_form', + [ + 'model' => $model, + ] +) ?> + +endContent() ?> diff --git a/src/User/resources/views/security/confirm.php b/src/User/resources/views/bootstrap5/security/confirm.php similarity index 100% rename from src/User/resources/views/security/confirm.php rename to src/User/resources/views/bootstrap5/security/confirm.php diff --git a/src/User/resources/views/security/login.php b/src/User/resources/views/bootstrap5/security/login.php similarity index 100% rename from src/User/resources/views/security/login.php rename to src/User/resources/views/bootstrap5/security/login.php diff --git a/src/User/resources/views/settings/_menu.php b/src/User/resources/views/bootstrap5/settings/_menu.php similarity index 100% rename from src/User/resources/views/settings/_menu.php rename to src/User/resources/views/bootstrap5/settings/_menu.php diff --git a/src/User/resources/views/settings/account.php b/src/User/resources/views/bootstrap5/settings/account.php similarity index 99% rename from src/User/resources/views/settings/account.php rename to src/User/resources/views/bootstrap5/settings/account.php index b2fba0dd..a18e01a5 100644 --- a/src/User/resources/views/settings/account.php +++ b/src/User/resources/views/bootstrap5/settings/account.php @@ -141,7 +141,7 @@ break; } ?> - +

+* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +?> + +
+

+ +

+
+ +
+
+
+ + + + +
+
+
diff --git a/src/User/resources/views/bootstrap5/settings/two-factor-sms.php b/src/User/resources/views/bootstrap5/settings/two-factor-sms.php new file mode 100644 index 00000000..ce033c9a --- /dev/null +++ b/src/User/resources/views/bootstrap5/settings/two-factor-sms.php @@ -0,0 +1,68 @@ + +* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +/** @var string $mobilePhone */ +?> + +
+
+

+ +

+
+ +
+
+
+ + + + +
+
+
+
+ +
+
+
+

+ +

+
+ +
+
+
+
+
+
+
+
+ + + + +
+
+
+
\ No newline at end of file diff --git a/src/User/resources/views/bootstrap5/settings/two-factor.php b/src/User/resources/views/bootstrap5/settings/two-factor.php new file mode 100644 index 00000000..439b82e0 --- /dev/null +++ b/src/User/resources/views/bootstrap5/settings/two-factor.php @@ -0,0 +1,47 @@ + +* +* For the full copyright and license information, please view +* the LICENSE file that was distributed with this source code. +*/ + +/** @var string $id */ +/** @var string $uri */ +/** @var Da\User\Model\User $user */ +?> + +
+

+ +

+
+ +
+
+ +
+
+
+
+ +
auth_tf_key ?>
+
+
+
+
+
+ + + + +
+
+
diff --git a/src/User/resources/views/shared/_alert.php b/src/User/resources/views/bootstrap5/shared/_alert.php similarity index 100% rename from src/User/resources/views/shared/_alert.php rename to src/User/resources/views/bootstrap5/shared/_alert.php diff --git a/src/User/resources/views/shared/_menu.php b/src/User/resources/views/bootstrap5/shared/_menu.php similarity index 100% rename from src/User/resources/views/shared/_menu.php rename to src/User/resources/views/bootstrap5/shared/_menu.php diff --git a/src/User/resources/views/shared/admin_layout.php b/src/User/resources/views/bootstrap5/shared/admin_layout.php similarity index 100% rename from src/User/resources/views/shared/admin_layout.php rename to src/User/resources/views/bootstrap5/shared/admin_layout.php diff --git a/src/User/resources/views/bootstrap5/shared/message.php b/src/User/resources/views/bootstrap5/shared/message.php new file mode 100644 index 00000000..8cb23e62 --- /dev/null +++ b/src/User/resources/views/bootstrap5/shared/message.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** @var \yii\web\View $this */ +/** @var string $content */ +/** @var string $title */ +/** @var \Da\User\Module $module */ + + +$this->title = $title; + +?> + +render( + '/shared/_alert', + [ + 'module' => $module, + ] +); diff --git a/src/User/resources/views/widgets/assignments/form.php b/src/User/resources/views/bootstrap5/widgets/assignments/form.php similarity index 100% rename from src/User/resources/views/widgets/assignments/form.php rename to src/User/resources/views/bootstrap5/widgets/assignments/form.php diff --git a/src/User/resources/views/widgets/login/form.php b/src/User/resources/views/bootstrap5/widgets/login/form.php similarity index 100% rename from src/User/resources/views/widgets/login/form.php rename to src/User/resources/views/bootstrap5/widgets/login/form.php From 5b97f059a90f5b57a53ccb0f496743b259e217ab Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:36:49 +0200 Subject: [PATCH 02/11] exclude bootstrap3 views from phpstan static code analysis. --- phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon b/phpstan.neon index 82b0ee8c..442b3125 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,5 +4,6 @@ parameters: - src excludePaths: - 'src/resources/i18n/*' + - 'src/views/bootstrap3/*' bootstrapFiles: - stan_autoload.php From 7462002f74adbffd8f4a4b6b133d94363093924f Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:38:27 +0200 Subject: [PATCH 03/11] add php8.3 to ci matrix --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 262d875c..b0e546b7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: operating-system: ['ubuntu-latest'] - php-versions: ['8.2','8.1', '8.0','7.4'] + php-versions: ['8.3', '8.2','8.1', '8.0','7.4'] services: mariadb: From 16edd2ec3fb77a24a580c111982264508875c4e6 Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:41:08 +0200 Subject: [PATCH 04/11] fix ignored bootstrap 3 paths, use latset mariadb for ci tests --- .github/workflows/php.yml | 4 ++-- phpstan.neon | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b0e546b7..880f9ee3 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -18,7 +18,7 @@ jobs: services: mariadb: - image: mariadb:10 + image: mariadb:latest ports: - 3306:3306 env: @@ -26,7 +26,7 @@ jobs: MYSQL_PASSWORD: password MYSQL_DATABASE: yii2-usuario-test MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=5s --health-timeout=5s --health-retries=3 steps: diff --git a/phpstan.neon b/phpstan.neon index 442b3125..3b7b08f6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,6 +4,6 @@ parameters: - src excludePaths: - 'src/resources/i18n/*' - - 'src/views/bootstrap3/*' + - 'src/resources/views/bootstrap3/*' bootstrapFiles: - stan_autoload.php From 18e1d4251559ed90df58f3602fc938e6dd63cf94 Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:44:10 +0200 Subject: [PATCH 05/11] fix ignored bootstrap 3 paths --- phpstan.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 3b7b08f6..bce03bcc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,7 +3,7 @@ parameters: paths: - src excludePaths: - - 'src/resources/i18n/*' - - 'src/resources/views/bootstrap3/*' + - 'src/User/resources/i18n/*' + - 'src/User/resources/views/bootstrap3/*' bootstrapFiles: - stan_autoload.php From 99a199e5d5ce2d779bec6fc25f3b9d0e78e8b305 Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 10:56:09 +0200 Subject: [PATCH 06/11] separate mailViewPath from general views (UI framework independent ) --- src/User/Module.php | 4 + src/User/Service/MailService.php | 2 +- .../views/bootstrap5/mail/confirmation.php | 34 -------- .../views/bootstrap5/mail/layouts/html.php | 78 ------------------- .../views/bootstrap5/mail/layouts/text.php | 23 ------ .../views/bootstrap5/mail/reconfirmation.php | 37 --------- .../views/bootstrap5/mail/recovery.php | 38 --------- .../bootstrap5/mail/text/confirmation.php | 25 ------ .../bootstrap5/mail/text/reconfirmation.php | 29 ------- .../views/bootstrap5/mail/text/recovery.php | 25 ------ .../bootstrap5/mail/text/twofactorcode.php | 22 ------ .../views/bootstrap5/mail/text/welcome.php | 40 ---------- .../views/bootstrap5/mail/twofactorcode.php | 30 ------- .../views/bootstrap5/mail/welcome.php | 52 ------------- .../{bootstrap3 => }/mail/confirmation.php | 0 .../{bootstrap3 => }/mail/layouts/html.php | 0 .../{bootstrap3 => }/mail/layouts/text.php | 0 .../{bootstrap3 => }/mail/reconfirmation.php | 0 .../views/{bootstrap3 => }/mail/recovery.php | 0 .../mail/text/confirmation.php | 0 .../mail/text/reconfirmation.php | 0 .../{bootstrap3 => }/mail/text/recovery.php | 0 .../mail/text/twofactorcode.php | 0 .../{bootstrap3 => }/mail/text/welcome.php | 0 .../{bootstrap3 => }/mail/twofactorcode.php | 0 .../views/{bootstrap3 => }/mail/welcome.php | 0 26 files changed, 5 insertions(+), 434 deletions(-) delete mode 100644 src/User/resources/views/bootstrap5/mail/confirmation.php delete mode 100644 src/User/resources/views/bootstrap5/mail/layouts/html.php delete mode 100644 src/User/resources/views/bootstrap5/mail/layouts/text.php delete mode 100644 src/User/resources/views/bootstrap5/mail/reconfirmation.php delete mode 100644 src/User/resources/views/bootstrap5/mail/recovery.php delete mode 100644 src/User/resources/views/bootstrap5/mail/text/confirmation.php delete mode 100644 src/User/resources/views/bootstrap5/mail/text/reconfirmation.php delete mode 100644 src/User/resources/views/bootstrap5/mail/text/recovery.php delete mode 100644 src/User/resources/views/bootstrap5/mail/text/twofactorcode.php delete mode 100644 src/User/resources/views/bootstrap5/mail/text/welcome.php delete mode 100644 src/User/resources/views/bootstrap5/mail/twofactorcode.php delete mode 100644 src/User/resources/views/bootstrap5/mail/welcome.php rename src/User/resources/views/{bootstrap3 => }/mail/confirmation.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/layouts/html.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/layouts/text.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/reconfirmation.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/recovery.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/text/confirmation.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/text/reconfirmation.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/text/recovery.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/text/twofactorcode.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/text/welcome.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/twofactorcode.php (100%) rename src/User/resources/views/{bootstrap3 => }/mail/welcome.php (100%) diff --git a/src/User/Module.php b/src/User/Module.php index d533468a..2cbbcda1 100755 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -225,6 +225,10 @@ class Module extends BaseModule * @var string */ public $viewPath = '@Da/User/resources/views/bootstrap5'; + /** + * @var string the mail views path is UI framework independent + */ + public $mailViewPath = '@Da/User/resources/views/mail'; /** * @var string the session key name to impersonate users. Please, modify it for security reasons! */ diff --git a/src/User/Service/MailService.php b/src/User/Service/MailService.php index 4e99d443..4aeefc22 100644 --- a/src/User/Service/MailService.php +++ b/src/User/Service/MailService.php @@ -51,7 +51,7 @@ public function __construct($type, $from, $to, $subject, $view, array $params, M $this->view = $view; $this->params = $params; $this->mailer = $mailer; - $this->viewPath = $this->getModule()->viewPath . '/mail'; + $this->viewPath = $this->getModule()->mailViewPath; $this->mailer->setViewPath($this->viewPath); $this->mailer->getView()->theme = Yii::$app->view->theme; } diff --git a/src/User/resources/views/bootstrap5/mail/confirmation.php b/src/User/resources/views/bootstrap5/mail/confirmation.php deleted file mode 100644 index 20eb842d..00000000 --- a/src/User/resources/views/bootstrap5/mail/confirmation.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -use yii\helpers\Html; - -/** - * @var \Da\User\Model\User $user - * @var \Da\User\Model\Token $token - */ -?> -

- , -

-

- name) ?>. - . -

-

- url), $token->url) ?> -

-

- . -

-

- Yii::$app->name]) ?>. -

diff --git a/src/User/resources/views/bootstrap5/mail/layouts/html.php b/src/User/resources/views/bootstrap5/mail/layouts/html.php deleted file mode 100644 index 96ba8066..00000000 --- a/src/User/resources/views/bootstrap5/mail/layouts/html.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var \yii\web\View $this - * @var string $content - */ -?> -beginPage() ?> - - - - - - head() ?> - - - - - - - - -
-
- - - - -
- beginBody() ?> - - endBody() ?> -
-
-
- - - - - - - - - -endPage() ?> diff --git a/src/User/resources/views/bootstrap5/mail/layouts/text.php b/src/User/resources/views/bootstrap5/mail/layouts/text.php deleted file mode 100644 index d5c064bd..00000000 --- a/src/User/resources/views/bootstrap5/mail/layouts/text.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** -/** - * @var \yii\web\View $this - * @var string $content - */ -?> - -beginPage() ?> -beginBody() ?> - -endBody() ?> -endPage() ?> diff --git a/src/User/resources/views/bootstrap5/mail/reconfirmation.php b/src/User/resources/views/bootstrap5/mail/reconfirmation.php deleted file mode 100644 index f41e543c..00000000 --- a/src/User/resources/views/bootstrap5/mail/reconfirmation.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -use yii\helpers\Html; - -/** - * @var \Da\User\Model\Token $token - */ -?> -

- , -

-

- name - ) ?>. - . -

-

- getUrl()), $token->getUrl()); ?> -

-

- . -

-

- . -

diff --git a/src/User/resources/views/bootstrap5/mail/recovery.php b/src/User/resources/views/bootstrap5/mail/recovery.php deleted file mode 100644 index c06e2761..00000000 --- a/src/User/resources/views/bootstrap5/mail/recovery.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -use yii\helpers\Html; - -/** - * @var \Da\User\Model\User $user - * @var \Da\User\Model\Token $token - */ -?> -

- , -

-

- name - ) ?>. - . -

-

- url), $token->url); ?> -

-

- . -

-

- . -

diff --git a/src/User/resources/views/bootstrap5/mail/text/confirmation.php b/src/User/resources/views/bootstrap5/mail/text/confirmation.php deleted file mode 100644 index 20a6928c..00000000 --- a/src/User/resources/views/bootstrap5/mail/text/confirmation.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var \Da\User\Model\Token $token - */ -?> -, - -name) ?>. -. - -url ?> - -. - - Yii::$app->name]) ?>. diff --git a/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php b/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php deleted file mode 100644 index 808139c7..00000000 --- a/src/User/resources/views/bootstrap5/mail/text/reconfirmation.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var \Da\User\Model\Token $token - */ -?> -, - -name -) ?>. -. - -url ?> - -. - -. diff --git a/src/User/resources/views/bootstrap5/mail/text/recovery.php b/src/User/resources/views/bootstrap5/mail/text/recovery.php deleted file mode 100644 index 08a7210d..00000000 --- a/src/User/resources/views/bootstrap5/mail/text/recovery.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var \Da\User\Model\Token $token - */ -?> -, - -name) ?>. -. - -url ?> - -. - -. diff --git a/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php b/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php deleted file mode 100644 index 17255661..00000000 --- a/src/User/resources/views/bootstrap5/mail/text/twofactorcode.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var String $code - */ -?> -, - -: - - - -. diff --git a/src/User/resources/views/bootstrap5/mail/text/welcome.php b/src/User/resources/views/bootstrap5/mail/text/welcome.php deleted file mode 100644 index 0d4516b3..00000000 --- a/src/User/resources/views/bootstrap5/mail/text/welcome.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -/** - * @var \Da\User\Model\User $user - * @var \Da\User\Model\Token $token - * @var \Da\User\Module $module - * @var bool $showPassword - */ - -use yii\helpers\Url; - -?> -, - -name) ?>. -generatePasswords): ?> - : - password ?> - -allowPasswordRecovery): ?> - : - - - - - . - url ?> - . - - - Yii::$app->name]) ?>. diff --git a/src/User/resources/views/bootstrap5/mail/twofactorcode.php b/src/User/resources/views/bootstrap5/mail/twofactorcode.php deleted file mode 100644 index 210f84c2..00000000 --- a/src/User/resources/views/bootstrap5/mail/twofactorcode.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -use yii\helpers\Html; - -/** - * @var String $code - * @var \Da\User\Model\Token $token - */ -?> -

- , -

-

- : -

-

- -

-

- . -

diff --git a/src/User/resources/views/bootstrap5/mail/welcome.php b/src/User/resources/views/bootstrap5/mail/welcome.php deleted file mode 100644 index 8efa10a9..00000000 --- a/src/User/resources/views/bootstrap5/mail/welcome.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view - * the LICENSE file that was distributed with this source code. - */ - -use yii\helpers\Html; -use yii\helpers\Url; - -/** - * @var \Da\User\Module $module - * @var \Da\User\Model\User $user - * @var \Da\User\Model\Token $token - * @var bool $showPassword - */ - -?> -

- , -

- -

- name) ?>. - generatePasswords): ?> - : password) ?> - - allowPasswordRecovery): ?> - : - - -

- - -

- . -

-

- url), $token->url); ?> -

-

- . -

- - -

- Yii::$app->name]) ?>. -

diff --git a/src/User/resources/views/bootstrap3/mail/confirmation.php b/src/User/resources/views/mail/confirmation.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/confirmation.php rename to src/User/resources/views/mail/confirmation.php diff --git a/src/User/resources/views/bootstrap3/mail/layouts/html.php b/src/User/resources/views/mail/layouts/html.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/layouts/html.php rename to src/User/resources/views/mail/layouts/html.php diff --git a/src/User/resources/views/bootstrap3/mail/layouts/text.php b/src/User/resources/views/mail/layouts/text.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/layouts/text.php rename to src/User/resources/views/mail/layouts/text.php diff --git a/src/User/resources/views/bootstrap3/mail/reconfirmation.php b/src/User/resources/views/mail/reconfirmation.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/reconfirmation.php rename to src/User/resources/views/mail/reconfirmation.php diff --git a/src/User/resources/views/bootstrap3/mail/recovery.php b/src/User/resources/views/mail/recovery.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/recovery.php rename to src/User/resources/views/mail/recovery.php diff --git a/src/User/resources/views/bootstrap3/mail/text/confirmation.php b/src/User/resources/views/mail/text/confirmation.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/text/confirmation.php rename to src/User/resources/views/mail/text/confirmation.php diff --git a/src/User/resources/views/bootstrap3/mail/text/reconfirmation.php b/src/User/resources/views/mail/text/reconfirmation.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/text/reconfirmation.php rename to src/User/resources/views/mail/text/reconfirmation.php diff --git a/src/User/resources/views/bootstrap3/mail/text/recovery.php b/src/User/resources/views/mail/text/recovery.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/text/recovery.php rename to src/User/resources/views/mail/text/recovery.php diff --git a/src/User/resources/views/bootstrap3/mail/text/twofactorcode.php b/src/User/resources/views/mail/text/twofactorcode.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/text/twofactorcode.php rename to src/User/resources/views/mail/text/twofactorcode.php diff --git a/src/User/resources/views/bootstrap3/mail/text/welcome.php b/src/User/resources/views/mail/text/welcome.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/text/welcome.php rename to src/User/resources/views/mail/text/welcome.php diff --git a/src/User/resources/views/bootstrap3/mail/twofactorcode.php b/src/User/resources/views/mail/twofactorcode.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/twofactorcode.php rename to src/User/resources/views/mail/twofactorcode.php diff --git a/src/User/resources/views/bootstrap3/mail/welcome.php b/src/User/resources/views/mail/welcome.php similarity index 100% rename from src/User/resources/views/bootstrap3/mail/welcome.php rename to src/User/resources/views/mail/welcome.php From fa8959cb8b207de55aa34d991592668c657ae36a Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 11:52:07 +0200 Subject: [PATCH 07/11] update condig, php 8.2 --- src/User/resources/views/bootstrap5/settings/account.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/User/resources/views/bootstrap5/settings/account.php b/src/User/resources/views/bootstrap5/settings/account.php index a18e01a5..86b687df 100644 --- a/src/User/resources/views/bootstrap5/settings/account.php +++ b/src/User/resources/views/bootstrap5/settings/account.php @@ -14,7 +14,6 @@ use yii\helpers\Url; use yii\bootstrap5\ActiveForm; use dmstr\widgets\Alert; - /** * @var yii\web\View $this * @var yii\widgets\ActiveForm $form @@ -79,7 +78,7 @@ enableTwoFactorAuthentication): ?> -
+

From cf6d4233b562f0a30c3eb46ea06058209aa0adc6 Mon Sep 17 00:00:00 2001 From: tonis Date: Fri, 16 Feb 2024 11:55:30 +0200 Subject: [PATCH 08/11] link the migration docs --- docs/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.md b/docs/index.md index ba11ab67..0bfd8f74 100755 --- a/docs/index.md +++ b/docs/index.md @@ -189,6 +189,7 @@ Helpful Guides - [Separate Frontend and Backend Sessions](guides/separate-frontend-and-backend-sessions.md) - [Social Network Authentication](guides/social-network-authentication.md) - [How to Enable session history](guides/how-to-use-session-history.md) +- [Migrating from v1 to v2](guides/migrating-to-v2.md) Contributing ------------ From 5019493cadb6066dac644b4f02fa07245911d5e3 Mon Sep 17 00:00:00 2001 From: tonis Date: Mon, 19 Feb 2024 16:29:38 +0200 Subject: [PATCH 09/11] fixed login etc cards not centered --- .../resources/views/bootstrap5/admin/_session-history.php | 2 +- src/User/resources/views/bootstrap5/admin/create.php | 2 +- src/User/resources/views/bootstrap5/recovery/request.php | 5 ++++- .../resources/views/bootstrap5/registration/register.php | 6 +++++- src/User/resources/views/bootstrap5/registration/resend.php | 4 +++- src/User/resources/views/bootstrap5/security/login.php | 6 ++++-- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/User/resources/views/bootstrap5/admin/_session-history.php b/src/User/resources/views/bootstrap5/admin/_session-history.php index c86f647b..ac0c96cd 100755 --- a/src/User/resources/views/bootstrap5/admin/_session-history.php +++ b/src/User/resources/views/bootstrap5/admin/_session-history.php @@ -29,7 +29,7 @@ beginContent($module->viewPath. '/admin/update.php', ['user' => $user]) ?>
-
+
$user->id], diff --git a/src/User/resources/views/bootstrap5/admin/create.php b/src/User/resources/views/bootstrap5/admin/create.php index 16b61f2c..43d980f1 100644 --- a/src/User/resources/views/bootstrap5/admin/create.php +++ b/src/User/resources/views/bootstrap5/admin/create.php @@ -32,7 +32,7 @@ ) ?>
-
+

title) ?>

diff --git a/src/User/resources/views/bootstrap5/recovery/request.php b/src/User/resources/views/bootstrap5/recovery/request.php index 0082377c..1e1fa619 100644 --- a/src/User/resources/views/bootstrap5/recovery/request.php +++ b/src/User/resources/views/bootstrap5/recovery/request.php @@ -22,7 +22,9 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+ +

title) ?>

@@ -44,4 +46,5 @@
+
diff --git a/src/User/resources/views/bootstrap5/registration/register.php b/src/User/resources/views/bootstrap5/registration/register.php index 4c89e9f0..905e2a16 100644 --- a/src/User/resources/views/bootstrap5/registration/register.php +++ b/src/User/resources/views/bootstrap5/registration/register.php @@ -23,7 +23,9 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+ +

title) ?>

@@ -58,4 +60,6 @@

+
+
diff --git a/src/User/resources/views/bootstrap5/registration/resend.php b/src/User/resources/views/bootstrap5/registration/resend.php index d25f392d..664c9151 100644 --- a/src/User/resources/views/bootstrap5/registration/resend.php +++ b/src/User/resources/views/bootstrap5/registration/resend.php @@ -21,7 +21,8 @@ $this->params['breadcrumbs'][] = $this->title; ?>
-
+
+

title) ?>

@@ -43,4 +44,5 @@
+
diff --git a/src/User/resources/views/bootstrap5/security/login.php b/src/User/resources/views/bootstrap5/security/login.php index db7d3360..a13bec14 100644 --- a/src/User/resources/views/bootstrap5/security/login.php +++ b/src/User/resources/views/bootstrap5/security/login.php @@ -25,8 +25,9 @@ render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> -
-
+
+
+

title) ?>

@@ -96,4 +97,5 @@ ] ) ?>
+
From 4f3188d6ceefd05441c1d0f8b7536b02ce0702dc Mon Sep 17 00:00:00 2001 From: tonis Date: Wed, 21 Feb 2024 09:42:46 +0200 Subject: [PATCH 10/11] make narrow dialog widths bs5 responsive --- src/User/resources/views/bootstrap5/recovery/request.php | 2 +- src/User/resources/views/bootstrap5/registration/register.php | 2 +- src/User/resources/views/bootstrap5/registration/resend.php | 2 +- src/User/resources/views/bootstrap5/security/login.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/User/resources/views/bootstrap5/recovery/request.php b/src/User/resources/views/bootstrap5/recovery/request.php index 1e1fa619..8d4341bb 100644 --- a/src/User/resources/views/bootstrap5/recovery/request.php +++ b/src/User/resources/views/bootstrap5/recovery/request.php @@ -24,7 +24,7 @@
-
+

title) ?>

diff --git a/src/User/resources/views/bootstrap5/registration/register.php b/src/User/resources/views/bootstrap5/registration/register.php index 905e2a16..8c9a05d4 100644 --- a/src/User/resources/views/bootstrap5/registration/register.php +++ b/src/User/resources/views/bootstrap5/registration/register.php @@ -25,7 +25,7 @@
-
+

title) ?>

diff --git a/src/User/resources/views/bootstrap5/registration/resend.php b/src/User/resources/views/bootstrap5/registration/resend.php index 664c9151..6a4b4d99 100644 --- a/src/User/resources/views/bootstrap5/registration/resend.php +++ b/src/User/resources/views/bootstrap5/registration/resend.php @@ -22,7 +22,7 @@ ?>
-
+

title) ?>

diff --git a/src/User/resources/views/bootstrap5/security/login.php b/src/User/resources/views/bootstrap5/security/login.php index a13bec14..1cf36588 100644 --- a/src/User/resources/views/bootstrap5/security/login.php +++ b/src/User/resources/views/bootstrap5/security/login.php @@ -27,7 +27,7 @@
-
+

title) ?>

From f60976c60a3678e6ab6b03bdb095619f098ba391 Mon Sep 17 00:00:00 2001 From: tonis Date: Mon, 26 Feb 2024 17:08:51 +0200 Subject: [PATCH 11/11] fixed 2fa-input not centered --- src/User/resources/views/bootstrap5/security/confirm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/User/resources/views/bootstrap5/security/confirm.php b/src/User/resources/views/bootstrap5/security/confirm.php index 728d2b9c..73fb81b5 100644 --- a/src/User/resources/views/bootstrap5/security/confirm.php +++ b/src/User/resources/views/bootstrap5/security/confirm.php @@ -25,8 +25,9 @@ render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?> -
-
+
+
+

title) ?>

@@ -66,4 +67,6 @@
+
+