Пример #1
0
echo Html::encode($this->title);
?>
</p>
<?php 
$form = ActiveForm::begin();
?>

<?php 
echo $form->field($model, 'email')->textInput(['placeholder' => $model->getAttributeLabel('email')])->label(false);
?>

<div class="row">
    <div class="col-xs-4">
        <a href="<?php 
echo Url::to(['login']);
?>
" class="btn btn-default btn-flat">
            <span class="glyphicon glyphicon-chevron-left"></span>
            <?php 
echo Theme::t('user', 'Use login');
?>
        </a>
    </div><!-- /.col -->
    <div class="col-xs-8">
        <?php 
echo Html::submitButton(Theme::t('user', 'Recover password'), ['class' => 'btn bg-olive btn-block btn-flat']);
?>
    </div><!-- /.col -->
</div>
<?php 
ActiveForm::end();
Пример #2
0
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
use yii\bootstrap\ActiveForm;
/**
 * @var $modules array
 */
$this->title = Theme::t('title', 'Admin');
$this->params['subtitle'] = Theme::t('title', 'Modules');
$this->params['breadcrumbs'] = [$this->title];
$form = ActiveForm::begin();
?>
<div class="row">
    <div class="col-xs-12">
        <?php 
Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'table-responsive no-padding'], 'buttonsTemplate' => '{refresh}', 'buttons' => ['refresh' => ['label' => Theme::t('admin', 'Refresh Modules'), 'url' => ['modules', 'refresh' => true], 'icon' => 'refresh']]]);
?>
        <table class="table table-hover">
            <tbody>
            <tr>
                <th>Name</th>
                <th>Package</th>
                <th>Required</th>
            </tr>
            <?php 
foreach ($modules as $category => $definitions) {
    ?>
                <tr>
                    <td colspan="3"><h3><?php 
    echo $category;
    ?>
Пример #3
0
<?php

/**
 * User update view.
 *
 * @var \yii\web\View $this View
 * @var array $roleArray Roles array
 * @var array $statusArray Statuses array
 */
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
$this->title = Theme::t('title', 'Users');
$this->params['subtitle'] = Theme::t('title', 'Update user');
$this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']];
$boxButtons = ['{cancel}'];
if (Yii::$app->user->can('userCreate')) {
    $boxButtons[] = '{create}';
}
if (Yii::$app->user->can('UserDelete')) {
    $boxButtons[] = '{delete}';
}
$boxButtons = !empty($boxButtons) ? implode(' ', $boxButtons) : null;
?>
<div class="row">
    <div class="col-sm-12">
        <?php 
$box = Box::begin(['title' => $this->params['subtitle'], 'renderBody' => false, 'options' => ['class' => 'box-success'], 'bodyOptions' => ['class' => 'table-responsive'], 'buttonsTemplate' => $boxButtons]);
echo $this->render('_form', ['user' => $user, 'profile' => $profile, 'roleArray' => $roleArray, 'statusArray' => $statusArray, 'box' => $box]);
Box::end();
?>
    </div>
Пример #4
0
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b><?php 
echo Theme::t('admin', 'Admin');
?>
</b> <?php 
echo Yii::$app->name;
?>
</span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only"><?php 
echo Theme::t('admin', 'Toggle navigation');
?>
</span>
            </a>
            <!-- Navbar Right Menu -->
            <?php 
echo $this->render('parts/navbar-custom-menu');
?>
        </nav>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <?php 
echo $this->render('parts/sidebar-menu');
Пример #5
0
<?php

/**
 * Users list view.
 *
 * @var \yii\base\View $this View
 * @var \yii\rbac\Role[] $roles Roles
 */
use app\modules\rbac\Module;
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
use yii\helpers\Json;
$this->title = Theme::t('title', 'RBAC');
$this->params['subtitle'] = Theme::t('title', 'Roles');
$this->params['breadcrumbs'] = [$this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <?php 
Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'no-padding']]);
?>

        <table class="table table-striped">
            <tbody>
            <tr>
                <th style="width: 10px">#</th>
                <th>Name</th>
                <th>Description</th>
                <th>Data</th>
            </tr>
Пример #6
0
use yii\helpers\Html;
/**
 * @var $roleArray string[]
 * @var $statusArray string[]
 */
$box->beginBody();
?>

<?php 
echo $form->field($user, 'username');
echo $form->field($user, 'email');
?>

<?php 
echo $form->field($user, 'password')->passwordInput();
echo $form->field($user, 'repassword')->passwordInput();
?>

<?php 
echo $form->field($user, 'status_id')->checkboxList($statusArray, ['prompt' => Theme::t('user', 'Select status')]);
?>

<?php 
echo $form->field($user, 'roles')->checkboxList($roleArray);
?>

<?php 
$box->endBody();
$box->beginFooter();
echo Html::submitButton($user->isNewRecord ? Theme::t('user', 'Create user') : Theme::t('user', 'Update user'), ['class' => $user->isNewRecord ? 'btn btn-primary btn-large' : 'btn btn-success btn-large']);
$box->endFooter();
Пример #7
0
<?php

use app\modules\admin\Module;
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
use yii\helpers\Url;
use yii\web\View;
/**
 * @var View $this
 * @var $modules array
 */
$this->title = Theme::t('title', 'Admin');
$this->params['subtitle'] = Theme::t('title', 'Site Preview');
$this->params['breadcrumbs'] = [$this->title];
$site = Module::siteUrl();
$js = <<<JS
    jQuery(function(\$) {
        var iframe = \$('iframe#sitepreview');

        iframe.load(function () {
            var ifcontent = iframe.contents();
            console.log('ifheight', iframe[0].contentWindow);
            iframe.height(ifcontent.height());
        });
    });
JS;
$this->registerJs($js);
?>
<div class="row"><div class="col-xs-12">
<?php 
Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'no-padding']]);
Пример #8
0
$this->title = Theme::t('title', 'Users');
$this->params['subtitle'] = Theme::t('title', 'Users list');
$this->params['breadcrumbs'] = [$this->title];
$gridId = 'users-grid';
$gridConfig = ['id' => $gridId, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], 'id', ['attribute' => 'username', 'format' => 'html', 'value' => function ($model) {
    return Html::a($model['username'], ['update', 'id' => $model['id']], ['data-pjax' => 0]);
}], 'email', ['attribute' => 'name', 'value' => 'profile.name'], ['attribute' => 'surname', 'value' => 'profile.surname'], ['attribute' => 'status_id', 'format' => 'html', 'value' => function ($model) {
    if ($model->status_id === $model::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status_id === $model::STATUS_INACTIVE) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->status . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status_id', $statusArray, ['class' => 'form-control', 'prompt' => Theme::t('user', 'Select status')])], ['attribute' => 'assignments', 'format' => 'html', 'value' => function ($model) {
    $assignments = [];
    foreach ($model->assignments as $assignment) {
        $assignments[] = '<span class="label label-default">' . $assignment->item_name . '</span>';
    }
    return implode(' ', $assignments);
}], ['attribute' => 'created_at', 'format' => 'date', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'dd.mm.yy']])], ['attribute' => 'updated_at', 'format' => 'date', 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'updated_at', 'options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'dd.mm.yy']])]]];
$boxButtons = $actions = [];
$showActions = false;
if (Yii::$app->user->can('BCreateUsers')) {
    $boxButtons[] = '{create}';
}
if (Yii::$app->user->can('BUpdateUsers')) {
    $actions[] = '{update}';
    $showActions = $showActions || true;
}
Пример #9
0
 * @var array $roleArray Roles array
 * @var array $statusArray Statuses array
 * @var \app\themes\admin\widgets\Box $box Box widget instance
 */
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
use yii\bootstrap\ActiveForm;
use app\modules\user\Module;
?>

<?php 
$form = ActiveForm::begin();
?>
<div class="row">
    <div class="col-sm-6">
        <?php 
$box = Box::begin(['title' => Theme::t('user', 'Main Information'), 'renderBody' => false, 'options' => ['class' => 'box-success'], 'bodyOptions' => ['class' => ''], 'buttonsTemplate' => $boxButtons]);
echo $this->render('_user_fields', ['box' => $box, 'form' => $form, 'user' => $user, 'roleArray' => $roleArray, 'statusArray' => $statusArray]);
Box::end();
?>
    </div>
    <div class="col-sm-6">
        <?php 
$box = Box::begin(['title' => Module::t('admin', 'Profile'), 'renderBody' => false, 'options' => ['class' => 'box-success'], 'bodyOptions' => ['class' => ''], 'buttonsTemplate' => $boxButtons]);
echo $this->render('_profile_fields', ['box' => $box, 'form' => $form, 'profile' => $profile]);
Box::end();
?>
    </div>
</div>
<?php 
ActiveForm::end();
?>

<div class="form-box">
    <div class="header"><?php 
echo Html::encode($this->title);
?>
</div>
    <?php 
$form = ActiveForm::begin();
?>
    <div class="body bg-gray">
        <?php 
echo $form->field($model, 'password')->passwordInput(['placeholder' => $model->getAttributeLabel('password')])->label(false);
?>
        <?php 
echo $form->field($model, 'repassword')->passwordInput(['placeholder' => $model->getAttributeLabel('repassword')])->label(false);
?>
        <?php 
echo $form->field($model, 'token', ['template' => "{input}\n{error}"])->hiddenInput();
?>
    </div>
    <div class="footer">
        <?php 
echo Html::submitButton(Theme::t('user', 'Confirm'), ['class' => 'btn bg-olive btn-block']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div>
Пример #11
0
            </div>
        </div><!-- /.col -->
        <div class="col-xs-4">
            <button type="submit" class="btn btn-primary btn-block btn-flat">
                <?php 
echo Theme::t('user', 'Login');
?>
            </button>
        </div><!-- /.col -->
    </div>
<?php 
ActiveForm::end();
?>

<a href="<?php 
echo Url::to(['/user/default/recovery']);
?>
"><?php 
echo Theme::t('user', 'I forgot my password');
?>
</a>
<?php 
ICheckAsset::register($this);
$js = <<<JS
\$('input').iCheck({
    checkboxClass: 'icheckbox_square-blue',
    radioClass: 'iradio_square-blue',
    increaseArea: '20%' // optional
});
JS;
$this->registerJs($js);
Пример #12
0
 *
 * @var yii\base\View $this View
 * @var string $name Error name
 * @var string $message Error message
 * @var Exception $exception Exception
 */
use app\themes\admin\Theme;
use yii\helpers\Html;
$this->title = $name;
?>
<div class="error-page">
    <h2 class="headline text-red"><?php 
echo Html::encode($this->title);
?>
</h2>
    <div class="error-content">
        <h3><i class="fa fa-warning text-red"></i> <?php 
echo Theme::t('error', 'Oops! Something went wrong.');
?>
</h3>
        <p>
            <?php 
echo Theme::t('error', 'We will work on fixing that right away.');
?>
            <?php 
echo Theme::t('error', 'Meanwhile, you may {dashboard} or try using the search form.', ['dashboard' => Html::a(Theme::t('error', 'return to dashboard'), ['/'])]);
?>
        </p>
    </div>
</div><!-- /.error-page -->
        <!-- User Account Menu -->
        <li class="dropdown user user-menu">
            <!-- Menu Toggle Button -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <!-- The user image in the navbar-->
                <img some-src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image"/>
                <!-- hidden-xs hides the username on small devices so only the image appears. -->
                <span class="hidden-xs"><?php 
echo $name;
?>
</span>
            </a>
            <ul class="dropdown-menu">
                <li>
                    <a href="#"><?php 
echo Theme::t('admin', 'Sign out');
?>
</a>
                </li>
            </ul>
        </li>
        <li>
            <a href="<?php 
echo Module::siteUrl();
?>
" target="_blank"><i class="fa fa-external-link"></i></a>
        </li>
        <!-- Control Sidebar Toggle Button -->
        <li>
            <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
        </li>
Пример #14
0
<?php

/**
 * Users list view.
 *
 * @var \yii\base\View $this View
 * @var array $permissions Permissions
 */
use app\themes\admin\Theme;
use app\themes\admin\widgets\Box;
$this->title = Theme::t('title', 'RBAC');
$this->params['subtitle'] = Theme::t('title', 'Permissions');
$this->params['breadcrumbs'] = [$this->title];
?>

    <div class="row">
        <div class="col-xs-12">
            <?php 
Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'no-padding']]);
?>

            <table class="table">
                <tbody>
                    <tr>
                        <th>Name</th>
                        <th>Description</th>
                    </tr>
                    <?php 
foreach ($permissions as $module => $definition) {
    ?>
                        <tr>
Пример #15
0
 /**
  * Register widgets assets bundles.
  */
 protected function registerClientScripts()
 {
     if (strpos($this->buttonsTemplate, '{delete}') !== false && isset($this->buttons['delete'])) {
         YiiAsset::register($this->getView());
     }
     if (strpos($this->buttonsTemplate, '{batch-delete}') !== false && $this->grid !== null && isset($this->buttons['batch-delete'])) {
         $view = $this->getView();
         YiiAsset::register($view);
         $view->registerJs("jQuery(document).on('click', '#batch-delete', function (evt) {" . "evt.preventDefault();" . "var keys = jQuery('#" . $this->grid . "').yiiGridView('getSelectedRows');" . "if (keys == '') {" . "alert('" . Theme::t('widgets/box', 'You need to select at least one item.') . "');" . "} else {" . "if (confirm('" . Theme::t('widgets/box', 'Are you sure you want to delete selected items?') . "')) {" . "jQuery.ajax({" . "type: 'POST'," . "url: jQuery(this).attr('href')," . "data: { " . $this->batchParam . ": keys}" . "});" . "}" . "}" . "});");
     }
 }