update folder location
This commit is contained in:
52
src/User/resources/views/settings/_menu.php
Normal file
52
src/User/resources/views/settings/_menu.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\Menu;
|
||||
|
||||
/** @var \Da\User\Model\User $user */
|
||||
$user = Yii::$app->user->identity;
|
||||
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
||||
|
||||
?>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<?= Html::img(
|
||||
$user->profile->getAvatarUrl(24),
|
||||
[
|
||||
'class' => 'img-rounded',
|
||||
'alt' => $user->username,
|
||||
]
|
||||
) ?>
|
||||
<?= $user->username ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?= Menu::widget(
|
||||
[
|
||||
'options' => [
|
||||
'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', 'Networks'),
|
||||
'url' => ['/user/settings/networks'],
|
||||
'visible' => $networksVisible,
|
||||
],
|
||||
],
|
||||
]
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
89
src/User/resources/views/settings/account.php
Normal file
89
src/User/resources/views/settings/account.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/*
|
||||
* @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;
|
||||
?>
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Html::encode($this->title) ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'id' => $model->formName(),
|
||||
'options' => ['class' => 'form-horizontal'],
|
||||
'fieldConfig' => [
|
||||
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
|
||||
'labelOptions' => ['class' => 'col-lg-3 control-label'],
|
||||
],
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'email') ?>
|
||||
|
||||
<?= $form->field($model, 'username') ?>
|
||||
|
||||
<?= $form->field($model, 'new_password')->passwordInput() ?>
|
||||
|
||||
<hr />
|
||||
|
||||
<?= $form->field($model, 'current_password')->passwordInput() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-block btn-success']) ?><br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($model->module->allowAccountDelete): ?>
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?= Yii::t('usuario', 'Delete account') ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
<?= Yii::t('usuario', 'Once you delete your account, there is no going back') ?>.
|
||||
<?= Yii::t('usuario', 'It will be deleted forever') ?>.
|
||||
<?= Yii::t('usuario', 'Please be certain') ?>.
|
||||
</p>
|
||||
<?= Html::a(Yii::t('usuario', 'Delete account'), ['delete'], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-method' => 'post',
|
||||
'data-confirm' => Yii::t('usuario', 'Are you sure? There is no going back'),
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
85
src/User/resources/views/settings/networks.php
Normal file
85
src/User/resources/views/settings/networks.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Da\User\Widget\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;
|
||||
?>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-info">
|
||||
<p><?= Yii::t('usuario', 'You can connect multiple accounts to be able to log in using them') ?>.</p>
|
||||
</div>
|
||||
<?php $auth = ConnectWidget::begin(
|
||||
[
|
||||
'baseAuthUrl' => ['/user/security/auth'],
|
||||
'accounts' => $user->socialNetworkAccounts,
|
||||
'autoRender' => false,
|
||||
'popupMode' => false,
|
||||
]
|
||||
) ?>
|
||||
<table class="table">
|
||||
<?php foreach ($auth->getClients() as $client): ?>
|
||||
<tr>
|
||||
<td style="width: 32px; vertical-align: middle">
|
||||
<?= Html::tag('span', '', ['class' => 'auth-icon '.$client->getName()]) ?>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<strong><?= $client->getTitle() ?></strong>
|
||||
</td>
|
||||
<td style="width: 120px">
|
||||
<?= $auth->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',
|
||||
]
|
||||
)
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php ConnectWidget::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
91
src/User/resources/views/settings/profile.php
Normal file
91
src/User/resources/views/settings/profile.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the 2amigos/yii2-usuario project.
|
||||
*
|
||||
* (c) 2amigOS! <http://2amigos.us/>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use Da\User\Helper\TimezoneHelper;
|
||||
|
||||
/*
|
||||
* @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);
|
||||
?>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<?= $this->render('/shared/_alert', ['module' => Yii::$app->getModule('user')]) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $this->render('_menu') ?>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?php $form = ActiveForm::begin(
|
||||
[
|
||||
'id' => $model->formName(),
|
||||
'options' => ['class' => 'form-horizontal'],
|
||||
'fieldConfig' => [
|
||||
'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
|
||||
'labelOptions' => ['class' => 'col-lg-3 control-label'],
|
||||
],
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnBlur' => false,
|
||||
]
|
||||
); ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'public_email') ?>
|
||||
|
||||
<?= $form->field($model, 'website') ?>
|
||||
|
||||
<?= $form->field($model, 'location') ?>
|
||||
|
||||
<?= $form
|
||||
->field($model, 'timezone')
|
||||
->dropDownList(ArrayHelper::map($timezoneHelper->getAll(), 'timezone', 'name'));
|
||||
?>
|
||||
<?= $form
|
||||
->field($model, 'gravatar_email')
|
||||
->hint(
|
||||
Html::a(
|
||||
Yii::t('usuario', 'Change your avatar at Gravatar.com'),
|
||||
'http://gravatar.com'
|
||||
)
|
||||
) ?>
|
||||
|
||||
<?= $form->field($model, 'bio')->textarea() ?>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-3 col-lg-9">
|
||||
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user