Commit 04d8ed31 by Alexander Makarov

Merge pull request #2327 from thiagotalma/master

Improvements in exhibition of the changed files in Gii.
parents b8235c71 7ddb6e8d
......@@ -35,9 +35,10 @@ yii.gii = (function ($) {
};
var initPreviewDiffLinks = function () {
$('.preview-code,.diff-code').on('click', function () {
$('.preview-code, .diff-code, .modal-refresh').on('click', function () {
var $modal = $('#preview-modal');
var $link = $(this);
$modal.find('.modal-refresh').attr('href', $link.prop('href'));
$modal.find('.modal-title').text($link.data('title'));
$modal.find('.modal-body').html('Loading ...');
$modal.modal('show');
......
......@@ -33,7 +33,18 @@ use yii\gii\CodeFile;
</thead>
<tbody>
<?php foreach ($files as $file): ?>
<tr class="<?= $file->operation ?>">
<?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', 'file' => $file->id], ['class' => 'preview-code', 'data-title' => $file->getRelativePath()]) ?>
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
......@@ -70,7 +81,7 @@ use yii\gii\CodeFile;
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Modal title</h4>
<h4><a class="modal-refresh glyphicon glyphicon-refresh" href="#"></a> <span class="modal-title">Modal title</span></h4>
</div>
<div class="modal-body">
<p>Please wait ...</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment