create.php 2.8 KB

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