profile.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. /*
  3. * This file is part of the Dektrium project.
  4. *
  5. * (c) Dektrium project <http://github.com/dektrium>
  6. *
  7. * For the full copyright and license information, please view the LICENSE.md
  8. * file that was distributed with this source code.
  9. */
  10. use yii\helpers\Html;
  11. use dektrium\user\helpers\Timezone;
  12. use yii\widgets\ActiveForm;
  13. use yii\helpers\ArrayHelper;
  14. /**
  15. * @var yii\web\View $this
  16. * @var yii\widgets\ActiveForm $form
  17. * @var dektrium\user\models\Profile $model
  18. */
  19. $this->title = Yii::t('user', 'Profile settings');
  20. $this->params['breadcrumbs'][] = $this->title;
  21. ?>
  22. <?= $this->render('/_alert', ['module' => Yii::$app->getModule('user')]) ?>
  23. <div class="row">
  24. <div class="col-md-3">
  25. <?= $this->render('_menu') ?>
  26. </div>
  27. <div class="col-md-9">
  28. <div class="panel panel-default">
  29. <div class="panel-heading">
  30. <?= Html::encode($this->title) ?>
  31. </div>
  32. <div class="panel-body">
  33. <?php $form = ActiveForm::begin([
  34. 'id' => 'profile-form',
  35. 'options' => ['class' => 'form-horizontal'],
  36. 'fieldConfig' => [
  37. 'template' => "{label}\n<div class=\"col-lg-9\">{input}</div>\n<div class=\"col-sm-offset-3 col-lg-9\">{error}\n{hint}</div>",
  38. 'labelOptions' => ['class' => 'col-lg-3 control-label'],
  39. ],
  40. 'enableAjaxValidation' => true,
  41. 'enableClientValidation' => false,
  42. 'validateOnBlur' => false,
  43. ]); ?>
  44. <?= $form->field($model, 'name') ?>
  45. <?= $form->field($model, 'public_email') ?>
  46. <?= $form->field($model, 'website') ?>
  47. <?= $form->field($model, 'location') ?>
  48. <?= $form
  49. ->field($model, 'timezone')
  50. ->dropDownList(
  51. ArrayHelper::map(
  52. Timezone::getAll(),
  53. 'timezone',
  54. 'name'
  55. )
  56. ); ?>
  57. <?= $form
  58. ->field($model, 'gravatar_email')
  59. ->hint(Html::a(Yii::t('user', 'Change your avatar at Gravatar.com'), 'http://gravatar.com')) ?>
  60. <?= $form->field($model, 'bio')->textarea() ?>
  61. <div class="form-group">
  62. <div class="col-lg-offset-3 col-lg-9">
  63. <?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
  64. <br>
  65. </div>
  66. </div>
  67. <?php ActiveForm::end(); ?>
  68. </div>
  69. </div>
  70. </div>
  71. </div>