create.php 2.8 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\bootstrap\ActiveForm;
  11. use yii\bootstrap\Nav;
  12. use yii\helpers\Html;
  13. /**
  14. * @var yii\web\View $this
  15. * @var dektrium\user\models\User $user
  16. */
  17. $this->title = Yii::t('user', 'Create a user account');
  18. $this->params['breadcrumbs'][] = ['label' => Yii::t('user', 'Users'), 'url' => ['index']];
  19. $this->params['breadcrumbs'][] = $this->title;
  20. ?>
  21. <?= $this->render('/_alert', [
  22. 'module' => Yii::$app->getModule('user'),
  23. ]) ?>
  24. <?= $this->render('_menu') ?>
  25. <div class="row">
  26. <div class="col-md-3">
  27. <div class="panel panel-default">
  28. <div class="panel-body">
  29. <?= Nav::widget([
  30. 'options' => [
  31. 'class' => 'nav-pills nav-stacked',
  32. ],
  33. 'items' => [
  34. ['label' => Yii::t('user', 'Account details'), 'url' => ['/user/admin/create']],
  35. ['label' => Yii::t('user', 'Profile details'), 'options' => [
  36. 'class' => 'disabled',
  37. 'onclick' => 'return false;',
  38. ]],
  39. ['label' => Yii::t('user', 'Information'), 'options' => [
  40. 'class' => 'disabled',
  41. 'onclick' => 'return false;',
  42. ]],
  43. ],
  44. ]) ?>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="col-md-9">
  49. <div class="panel panel-default">
  50. <div class="panel-body">
  51. <div class="alert alert-info">
  52. <?= Yii::t('user', 'Credentials will be sent to the user by email') ?>.
  53. <?= Yii::t('user', 'A password will be generated automatically if not provided') ?>.
  54. </div>
  55. <?php $form = ActiveForm::begin([
  56. 'layout' => 'horizontal',
  57. 'enableAjaxValidation' => true,
  58. 'enableClientValidation' => false,
  59. 'fieldConfig' => [
  60. 'horizontalCssClasses' => [
  61. 'wrapper' => 'col-sm-9',
  62. ],
  63. ],
  64. ]); ?>
  65. <?= $this->render('_user', ['form' => $form, 'user' => $user]) ?>
  66. <div class="form-group">
  67. <div class="col-lg-offset-3 col-lg-9">
  68. <?= Html::submitButton(Yii::t('user', 'Save'), ['class' => 'btn btn-block btn-success']) ?>
  69. </div>
  70. </div>
  71. <?php ActiveForm::end(); ?>
  72. </div>
  73. </div>
  74. </div>
  75. </div>