Yii2 Bootstrap 3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

11 years ago
<?php
use yii\gii\Generator;
use yii\helpers\Html;
use yii\gii\CodeFile;
/**
* @var $this \yii\base\View
* @var $generator \yii\gii\Generator
* @var CodeFile[] $files
11 years ago
* @var array $answers
11 years ago
*/
?>
<table class="table table-bordered table-striped table-condensed code-files">
<thead>
<tr>
<th class="file">Code File</th>
<th class="action">Action</th>
11 years ago
<th>
11 years ago
<?php
$count = 0;
foreach ($files as $file) {
if ($file->operation !== CodeFile::OP_SKIP) {
$count++;
}
}
if ($count > 1) {
11 years ago
echo '<input type="checkbox" id="check-all">';
11 years ago
}
?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($files as $i => $file): ?>
<tr class="<?php echo $file->operation; ?>">
<td class="file">
<?php echo Html::a(Html::encode($file->getRelativePath()), array('code', 'file' => $i), array('class' => 'view-code', 'rel' => $file->path)); ?>
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
11 years ago
<?php echo Html::a('diff', array('diff', 'file' => $i), array('class' => 'view-code label label-warning', 'rel' => $file->path)); ?>
11 years ago
<?php endif; ?>
</td>
<td class="action">
<?php
if ($file->operation === CodeFile::OP_SKIP) {
echo 'unchanged';
} else {
echo $file->operation;
}
?>
</td>
<td class="check">
<?php
if ($file->operation === CodeFile::OP_SKIP) {
echo '&nbsp;';
} else {
$key = md5($file->path);
11 years ago
echo Html::checkBox("answers[$key]", isset($answers) ? isset($answers[$key]) : ($file->operation === CodeFile::OP_NEW));
11 years ago
}
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>