documentation update + code fixes

This commit is contained in:
Antonio Ramirez
2017-06-11 23:25:51 +02:00
parent 4dedf111a1
commit 7344ad31df
91 changed files with 1699 additions and 827 deletions

View File

@ -11,7 +11,7 @@
/**
* @var yii\widgets\ActiveForm
* @var \Da\User\Model\User $user
* @var \Da\User\Model\User $user
*/
?>

View File

@ -78,7 +78,10 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="panel-body">
<div class="alert alert-info">
<?= Yii::t('usuario', 'Credentials will be sent to the user by email') ?>.
<?= Yii::t('usuario', 'A password will be generated automatically if not provided') ?>.
<?= Yii::t(
'usuario',
'A password will be generated automatically if not provided'
) ?>.
</div>
<?php $form = ActiveForm::begin(
[

View File

@ -40,7 +40,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'registration_ip',
'value' => function ($model) {
return $model->registration_ip == null
? '<span class="not-set">'.Yii::t('usuario', '(not set)').'</span>'
? '<span class="not-set">' . Yii::t('usuario', '(not set)') . '</span>'
: $model->registration_ip;
},
'format' => 'html',
@ -50,9 +50,9 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => function ($model) {
if (extension_loaded('intl')) {
return Yii::t('usuario', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]);
} else {
return date('Y-m-d G:i:s', $model->created_at);
}
return date('Y-m-d G:i:s', $model->created_at);
},
],
[
@ -60,19 +60,19 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => function ($model) {
if ($model->isConfirmed) {
return '<div class="text-center">
<span class="text-success">' .Yii::t('usuario', 'Confirmed').'</span>
<span class="text-success">' . Yii::t('usuario', 'Confirmed') . '</span>
</div>';
} else {
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?'),
]
);
}
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,
@ -90,17 +90,17 @@ $this->params['breadcrumbs'][] = $this->title;
'data-confirm' => Yii::t('usuario', 'Are you sure you want to unblock this user?'),
]
);
} else {
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?'),
]
);
}
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',
],

View File

@ -11,8 +11,8 @@
use Da\User\Model\User;
use yii\bootstrap\Nav;
use yii\web\View;
use yii\helpers\Html;
use yii\web\View;
/*
* @var View $this

View File

@ -15,20 +15,27 @@
*/
?>
<?php $this->beginPage() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<?php $this->head() ?>
</head>
<body bgcolor="#f6f6f6" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; margin: 0; padding: 0;">
<table class="body-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 20px;">
<body bgcolor="#f6f6f6"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; margin: 0; padding: 0;">
<table class="body-wrap"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 20px;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
<td class="container" bgcolor="#FFFFFF" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0; border: 1px solid #f0f0f0;">
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
<td class="container" bgcolor="#FFFFFF"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0; border: 1px solid #f0f0f0;">
<div class="content"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<?php $this->beginBody() ?>
@ -42,21 +49,28 @@
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
</tr>
</table>
<table class="footer-wrap" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; clear: both !important; margin: 0; padding: 0;"><tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"><td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
<td class="container" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0;">
<div class="content" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<td align="center" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 1.6; color: #666; font-weight: normal; margin: 0 0 10px; padding: 0;">
© <?= Yii::$app->name ?> <?= date('Y') ?>.
</p>
</td>
</tr>
</table>
</div>
</td>
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
<table class="footer-wrap"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; clear: both !important; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
<td class="container"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto; padding: 0;">
<div class="content"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
<table
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; width: 100%; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<td align="center"
style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;">
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 1.6; color: #666; font-weight: normal; margin: 0 0 10px; padding: 0;">
© <?= Yii::$app->name ?> <?= date('Y') ?>.
</p>
</td>
</tr>
</table>
</div>
</td>
<td style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 100%; line-height: 1.6; margin: 0; padding: 0;"></td>
</tr>
</table>
</body>

View File

@ -20,7 +20,11 @@ use yii\helpers\Html;
<?= Yii::t('usuario', 'Hello') ?>,
</p>
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">
<?= Yii::t('usuario', 'We have received a request to reset the password for your account on {0}', Yii::$app->name) ?>.
<?= Yii::t(
'usuario',
'We have received a request to reset the password for your account on {0}',
Yii::$app->name
) ?>.
<?= Yii::t('usuario', 'Please click the link below to complete your password reset') ?>.
</p>
<p style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; font-weight: normal; margin: 0 0 10px; padding: 0;">

View File

@ -12,7 +12,7 @@
/**
* @var \Da\User\Model\User
* @var \Da\User\Model\Token $token
* @var \Da\User\Module $module
* @var \Da\User\Module $module
*/
?>
<?= Yii::t('usuario', 'Hello') ?>,

View File

@ -21,10 +21,12 @@ use yii\widgets\ActiveForm;
?>
<?php $form = ActiveForm::begin([
'enableClientValidation' => false,
'enableAjaxValidation' => true,
]) ?>
<?php $form = ActiveForm::begin(
[
'enableClientValidation' => false,
'enableAjaxValidation' => true,
]
) ?>
<?= $form->field($model, 'name') ?>
@ -32,13 +34,16 @@ use yii\widgets\ActiveForm;
<?= $form->field($model, 'rule') ?>
<?= $form->field($model, 'children')->widget(SelectizeDropDownList::class, [
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]) ?>
<?= $form->field($model, 'children')->widget(
SelectizeDropDownList::class,
[
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]
) ?>
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>

View File

@ -56,7 +56,7 @@ $this->params['breadcrumbs'][] = $this->title;
'class' => ActionColumn::className(),
'template' => '{update} {delete}',
'urlCreator' => function ($action, $model) {
return Url::to(['/user/permission/'.$action, 'name' => $model['name']]);
return Url::to(['/user/permission/' . $action, 'name' => $model['name']]);
},
'options' => [
'style' => 'width: 5%',

View File

@ -23,10 +23,13 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="row">
<div class="col-sm-6 col-md-4">
<?= Html::img($profile->getAvatarUrl(230), [
'class' => 'img-rounded img-responsive',
'alt' => $profile->user->username,
]) ?>
<?= Html::img(
$profile->getAvatarUrl(230),
[
'class' => 'img-rounded img-responsive',
'alt' => $profile->user->username,
]
) ?>
</div>
<div class="col-sm-6 col-md-8">
<h4><?= $this->title ?></h4>
@ -46,8 +49,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?php if (!empty($profile->public_email)): ?>
<li>
<i class="glyphicon glyphicon-envelope text-muted"></i>
<?= Html::a(Html::encode($profile->public_email), 'mailto:'.
Html::encode($profile->public_email))
<?= Html::a(
Html::encode($profile->public_email),
'mailto:' .
Html::encode($profile->public_email)
)
?>
</li>
<?php endif; ?>

View File

@ -35,13 +35,16 @@ $unassignedItems = Yii::$container->get(AuthHelper::class)->getUnassignedItems($
<?= $form->field($model, 'rule') ?>
<?= $form->field($model, 'children')->widget(SelectizeDropDownList::class, [
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]) ?>
<?= $form->field($model, 'children')->widget(
SelectizeDropDownList::class,
[
'items' => $unassignedItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]
) ?>
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-success btn-block']) ?>

View File

@ -57,7 +57,7 @@ $this->params['breadcrumbs'][] = $this->title;
'class' => ActionColumn::className(),
'template' => '{update} {delete}',
'urlCreator' => function ($action, $model) {
return Url::to(['/user/role/'.$action, 'name' => $model['name']]);
return Url::to(['/user/role/' . $action, 'name' => $model['name']]);
},
'options' => [
'style' => 'width: 5%',

View File

@ -58,13 +58,13 @@ $this->params['breadcrumbs'][] = $this->title;
->passwordInput()
->label(
Yii::t('usuario', 'Password')
.($module->allowPasswordRecovery ?
' ('.Html::a(
. ($module->allowPasswordRecovery ?
' (' . Html::a(
Yii::t('usuario', 'Forgot password?'),
['/user/recovery/request'],
['tabindex' => '5']
)
.')' : '')
. ')' : '')
) ?>
<?= $form->field($model, 'rememberMe')->checkbox(['tabindex' => '4']) ?>
@ -79,7 +79,10 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
<?php if ($module->enableEmailConfirmation): ?>
<p class="text-center">
<?= Html::a(Yii::t('usuario', 'Didn\'t receive confirmation message?'), ['/user/registration/resend']) ?>
<?= Html::a(
Yii::t('usuario', 'Didn\'t receive confirmation message?'),
['/user/registration/resend']
) ?>
</p>
<?php endif ?>
<?php if ($module->enableRegistration): ?>

View File

@ -35,16 +35,18 @@ $this->params['breadcrumbs'][] = $this->title;
<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,
]); ?>
<?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') ?>
@ -52,13 +54,14 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'new_password')->passwordInput() ?>
<hr />
<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>
<?= Html::submitButton(Yii::t('usuario', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
<br>
</div>
</div>
@ -77,11 +80,15 @@ $this->params['breadcrumbs'][] = $this->title;
<?= 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'),
]) ?>
<?= 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 ?>

View File

@ -37,7 +37,8 @@ $this->params['breadcrumbs'][] = $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>
<p><?= Yii::t('usuario', 'You can connect multiple accounts to be able to log in using them') ?>
.</p>
</div>
<?php $auth = ConnectWidget::begin(
[
@ -51,7 +52,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php foreach ($auth->getClients() as $client): ?>
<tr>
<td style="width: 32px; vertical-align: middle">
<?= Html::tag('span', '', ['class' => 'auth-icon '.$client->getName()]) ?>
<?= Html::tag('span', '', ['class' => 'auth-icon ' . $client->getName()]) ?>
</td>
<td style="vertical-align: middle">
<strong><?= $client->getTitle() ?></strong>

View File

@ -9,10 +9,10 @@
* 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;
use yii\helpers\ArrayHelper;
use Da\User\Helper\TimezoneHelper;
/*
* @var yii\web\View $this

View File

@ -21,10 +21,12 @@ use yii\bootstrap\Alert;
<div class="col-xs-12">
<?php foreach (Yii::$app->session->getAllFlashes() as $type => $message): ?>
<?php if (in_array($type, ['success', 'danger', 'warning', 'info'], true)): ?>
<?= Alert::widget([
'options' => ['class' => 'alert-dismissible alert-'.$type],
<?= Alert::widget(
[
'options' => ['class' => 'alert-dismissible alert-' . $type],
'body' => $message,
]) ?>
]
) ?>
<?php endif ?>
<?php endforeach ?>
</div>

View File

@ -12,7 +12,7 @@
/**
* @var yii\web\View
* @var \Da\User\Module $module
* @var string $title
* @var string $title
*/
$this->title = $title;

View File

@ -24,29 +24,36 @@ use yii\widgets\ActiveForm;
<?php if ($model->updated): ?>
<?= Alert::widget([
'options' => [
'class' => 'alert-success',
],
'body' => Yii::t('usuario', 'Assignments have been updated'),
]) ?>
<?= Alert::widget(
[
'options' => [
'class' => 'alert-success',
],
'body' => Yii::t('usuario', 'Assignments have been updated'),
]
) ?>
<?php endif ?>
<?php $form = ActiveForm::begin([
'enableClientValidation' => false,
'enableAjaxValidation' => false,
]) ?>
<?php $form = ActiveForm::begin(
[
'enableClientValidation' => false,
'enableAjaxValidation' => false,
]
) ?>
<?= Html::activeHiddenInput($model, 'user_id') ?>
<?= $form->field($model, 'items')->widget(SelectizeDropDownList::class, [
'items' => $availableItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]) ?>
<?= $form->field($model, 'items')->widget(
SelectizeDropDownList::class,
[
'items' => $availableItems,
'options' => [
'id' => 'children',
'multiple' => true,
],
]
) ?>
<?= Html::submitButton(Yii::t('usuario', 'Update assignments'), ['class' => 'btn btn-success btn-block']) ?>

View File

@ -9,9 +9,9 @@
* the LICENSE file that was distributed with this source code.
*/
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
/*
* @var yii\web\View $this
@ -23,15 +23,17 @@ use yii\helpers\Html;
?>
<?php if (Yii::$app->user->isGuest): ?>
<?php $form = ActiveForm::begin([
'id' => 'login-widget-form',
'action' => Url::to(['/user/security/login']),
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnBlur' => false,
'validateOnType' => false,
'validateOnChange' => false,
]) ?>
<?php $form = ActiveForm::begin(
[
'id' => 'login-widget-form',
'action' => Url::to(['/user/security/login']),
'enableAjaxValidation' => true,
'enableClientValidation' => false,
'validateOnBlur' => false,
'validateOnType' => false,
'validateOnChange' => false,
]
) ?>
<?= $form->field($model, 'login')->textInput(['placeholder' => 'Login']) ?>
@ -43,8 +45,12 @@ use yii\helpers\Html;
<?php ActiveForm::end(); ?>
<?php else: ?>
<?= Html::a(Yii::t('usuario', 'Logout'), ['/user/security/logout'], [
'class' => 'btn btn-danger btn-block',
'data-method' => 'post',
]) ?>
<?= Html::a(
Yii::t('usuario', 'Logout'),
['/user/security/logout'],
[
'class' => 'btn btn-danger btn-block',
'data-method' => 'post',
]
) ?>
<?php endif ?>