This commit is contained in:
2020-03-27 10:13:51 +07:00
commit da1024a5b3
16614 changed files with 3274282 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
<?php
/* @var $this yii\web\View */
/* @var $diff mixed */
?>
<div class="default-diff">
<?php if ($diff === false): ?>
<div class="alert alert-danger">Diff is not supported for this file type.</div>
<?php elseif (empty($diff)): ?>
<div class="alert alert-success">Identical.</div>
<?php else: ?>
<div class="content"><?= $diff ?></div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,30 @@
<?php
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $generators \yii\gii\Generator[] */
/* @var $content string */
$generators = Yii::$app->controller->module->generators;
$this->title = 'Welcome to Gii';
?>
<div class="default-index">
<div class="page-header">
<h1>Welcome to Gii <small>a magical tool that can write code for you</small></h1>
</div>
<p class="lead">Start the fun with the following code generators:</p>
<div class="row">
<?php foreach ($generators as $id => $generator): ?>
<div class="generator col-lg-4">
<h3><?= Html::encode($generator->getName()) ?></h3>
<p><?= $generator->getDescription() ?></p>
<p><?= Html::a('Start &raquo;', ['default/view', 'id' => $id], ['class' => 'btn btn-default']) ?></p>
</div>
<?php endforeach; ?>
</div>
<p><a class="btn btn-success" href="http://www.yiiframework.com/extensions/?tag=gii">Get More Generators</a></p>
</div>

View File

@@ -0,0 +1,71 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\gii\components\ActiveField;
use yii\gii\CodeFile;
/* @var $this yii\web\View */
/* @var $generator yii\gii\Generator */
/* @var $id string panel ID */
/* @var $form yii\widgets\ActiveForm */
/* @var $results string */
/* @var $hasError bool */
/* @var $files CodeFile[] */
/* @var $answers array */
$this->title = $generator->getName();
$templates = [];
foreach ($generator->templates as $name => $path) {
$templates[$name] = "$name ($path)";
}
?>
<div class="default-view">
<h1><?= Html::encode($this->title) ?></h1>
<p><?= $generator->getDescription() ?></p>
<?php $form = ActiveForm::begin([
'id' => "$id-generator",
'successCssClass' => '',
'fieldConfig' => ['class' => ActiveField::className()],
]); ?>
<div class="row">
<div class="col-lg-8 col-md-10" id="form-fields">
<?= $this->renderFile($generator->formView(), [
'generator' => $generator,
'form' => $form,
]) ?>
<?= $form->field($generator, 'template')->sticky()
->label('Code Template')
->dropDownList($templates)->hint('
Please select which set of the templates should be used to generated the code.
') ?>
<div class="form-group">
<?= Html::submitButton('Preview', ['name' => 'preview', 'class' => 'btn btn-primary']) ?>
<?php if (isset($files)): ?>
<?= Html::submitButton('Generate', ['name' => 'generate', 'class' => 'btn btn-success']) ?>
<?php endif; ?>
</div>
</div>
</div>
<?php
if (isset($results)) {
echo $this->render('view/results', [
'generator' => $generator,
'results' => $results,
'hasError' => $hasError,
]);
} elseif (isset($files)) {
echo $this->render('view/files', [
'id' => $id,
'generator' => $generator,
'files' => $files,
'answers' => $answers,
]);
}
?>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,121 @@
<?php
use yii\helpers\Html;
use yii\gii\CodeFile;
/* @var $this \yii\web\View */
/* @var $generator \yii\gii\Generator */
/* @var $files CodeFile[] */
/* @var $answers array */
/* @var $id string panel ID */
?>
<div class="default-view-files">
<p>Click on the above <code>Generate</code> button to generate the files selected below:</p>
<div class="row form-group">
<div class="col-xs-6">
<input id="filter-input" class="form-control" placeholder="Type to filter">
</div>
<div class="col-xs-6 text-right">
<div id="action-toggle" class="btn-group btn-group-xs"">
<label class="btn btn-success active" title="Filter files that are created">
<input type="checkbox" value="<?= CodeFile::OP_CREATE ?>" checked> Create
</label>
<label class="btn btn-default active" title="Filter files that are unchanged.">
<input type="checkbox" value="<?= CodeFile::OP_SKIP ?>" checked> Unchanged
</label>
<label class="btn btn-warning active" title="Filter files that are overwritten">
<input type="checkbox" value="<?= CodeFile::OP_OVERWRITE ?>" checked> Overwrite
</label>
</div>
</div>
</div>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th class="file">Code File</th>
<th class="action">Action</th>
<?php
$fileChangeExists = false;
foreach ($files as $file) {
if ($file->operation !== CodeFile::OP_SKIP) {
$fileChangeExists = true;
echo '<th><input type="checkbox" id="check-all"></th>';
break;
}
}
?>
</tr>
</thead>
<tbody id="files-body">
<?php foreach ($files as $file): ?>
<?php
if ($file->operation === CodeFile::OP_OVERWRITE) {
$trClass = 'warning';
} elseif ($file->operation === CodeFile::OP_SKIP) {
$trClass = 'active';
} elseif ($file->operation === CodeFile::OP_CREATE) {
$trClass = 'success';
} else {
$trClass = '';
}
?>
<tr class="<?= "$file->operation $trClass" ?>">
<td class="file">
<?= Html::a(Html::encode($file->getRelativePath()), ['preview', 'id' => $id, 'file' => $file->id], ['class' => 'preview-code', 'data-title' => $file->getRelativePath()]) ?>
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
<?= Html::a('diff', ['diff', 'id' => $id, 'file' => $file->id], ['class' => 'diff-code label label-warning', 'data-title' => $file->getRelativePath()]) ?>
<?php endif; ?>
</td>
<td class="action">
<?php
if ($file->operation === CodeFile::OP_SKIP) {
echo 'unchanged';
} else {
echo $file->operation;
}
?>
</td>
<?php if ($fileChangeExists): ?>
<td class="check">
<?php
if ($file->operation === CodeFile::OP_SKIP) {
echo '&nbsp;';
} else {
echo Html::checkBox("answers[{$file->id}]", isset($answers) ? isset($answers[$file->id]) : ($file->operation === CodeFile::OP_CREATE));
}
?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="modal fade" id="preview-modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<div class="btn-group pull-left">
<a class="modal-previous btn btn-xs btn-default" href="#" title="Previous File (Left Arrow)"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a class="modal-next btn btn-xs btn-default" href="#" title="Next File (Right Arrow)"><span class="glyphicon glyphicon-arrow-right"></span></a>
<a class="modal-refresh btn btn-xs btn-default" href="#" title="Refresh File (R)"><span class="glyphicon glyphicon-refresh"></span></a>
<a class="modal-checkbox btn btn-xs btn-default" href="#" title="Check This File (Space)"><span class="glyphicon"></span></a>
&nbsp;
</div>
<strong class="modal-title pull-left">Modal title</strong>
<span class="modal-copy-hint pull-right"><kbd>CTRL</kbd>+<kbd>C</kbd> to copy</span>
<div id="clipboard-container"><textarea id="clipboard"></textarea></div>
<div class="clearfix"></div>
</div>
<div class="modal-body">
<p>Please wait ...</p>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,16 @@
<?php
/* @var $this yii\web\View */
/* @var $generator yii\gii\Generator */
/* @var $results string */
/* @var $hasError bool */
?>
<div class="default-view-results">
<?php
if ($hasError) {
echo '<div class="alert alert-danger">There was something wrong when generating the code. Please check the following messages.</div>';
} else {
echo '<div class="alert alert-success">' . $generator->successMessage() . '</div>';
}
?>
<pre><?= nl2br($results) ?></pre>
</div>

View File

@@ -0,0 +1,30 @@
<?php
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $generators \yii\gii\Generator[] */
/* @var $activeGenerator \yii\gii\Generator */
/* @var $content string */
$generators = Yii::$app->controller->module->generators;
$activeGenerator = Yii::$app->controller->generator;
?>
<?php $this->beginContent('@yii/gii/views/layouts/main.php'); ?>
<div class="row">
<div class="col-md-3 col-sm-4">
<div class="list-group">
<?php
foreach ($generators as $id => $generator) {
$label = '<i class="glyphicon glyphicon-chevron-right"></i>' . Html::encode($generator->getName());
echo Html::a($label, ['default/view', 'id' => $id], [
'class' => $generator === $activeGenerator ? 'list-group-item active' : 'list-group-item',
]);
}
?>
</div>
</div>
<div class="col-md-9 col-sm-8">
<?= $content ?>
</div>
</div>
<?php $this->endContent(); ?>

View File

@@ -0,0 +1,55 @@
<?php
use yii\bootstrap\NavBar;
use yii\bootstrap\Nav;
use yii\helpers\Html;
/* @var $this \yii\web\View */
/* @var $content string */
$asset = yii\gii\GiiAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="none">
<?php $this->registerCsrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
<body>
<div class="container-fluid page-container">
<?php $this->beginBody() ?>
<?php
NavBar::begin([
'brandLabel' => Html::img($asset->baseUrl . '/logo.png'),
'brandUrl' => ['default/index'],
'options' => ['class' => 'navbar-inverse navbar-fixed-top'],
]);
echo Nav::widget([
'options' => ['class' => 'nav navbar-nav navbar-right'],
'items' => [
['label' => 'Home', 'url' => ['default/index']],
['label' => 'Help', 'url' => 'http://www.yiiframework.com/doc-2.0/ext-gii-index.html'],
['label' => 'Application', 'url' => Yii::$app->homeUrl],
],
]);
NavBar::end();
?>
<div class="container content-container">
<?= $content ?>
</div>
<div class="footer-fix"></div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-left">A Product of <a href="http://www.yiisoft.com/">Yii Software LLC</a></p>
<p class="pull-right"><?= Yii::powered() ?></p>
</div>
</footer>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>