Commit dbe18d7b by Thiago Talma

Improvements in view of changed files in Gii

parent afa6ad5a
...@@ -35,9 +35,10 @@ yii.gii = (function ($) { ...@@ -35,9 +35,10 @@ yii.gii = (function ($) {
}; };
var initPreviewDiffLinks = 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 $modal = $('#preview-modal');
var $link = $(this); var $link = $(this);
$modal.find('.modal-refresh').attr('href', $link.prop('href'));
$modal.find('.modal-title').text($link.data('title')); $modal.find('.modal-title').text($link.data('title'));
$modal.find('.modal-body').html('Loading ...'); $modal.find('.modal-body').html('Loading ...');
$modal.modal('show'); $modal.modal('show');
......
...@@ -33,7 +33,18 @@ use yii\gii\CodeFile; ...@@ -33,7 +33,18 @@ use yii\gii\CodeFile;
</thead> </thead>
<tbody> <tbody>
<?php foreach ($files as $file): ?> <?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"> <td class="file">
<?= Html::a(Html::encode($file->getRelativePath()), ['preview', 'file' => $file->id], ['class' => 'preview-code', 'data-title' => $file->getRelativePath()]) ?> <?= Html::a(Html::encode($file->getRelativePath()), ['preview', 'file' => $file->id], ['class' => 'preview-code', 'data-title' => $file->getRelativePath()]) ?>
<?php if ($file->operation === CodeFile::OP_OVERWRITE): ?> <?php if ($file->operation === CodeFile::OP_OVERWRITE): ?>
...@@ -70,7 +81,7 @@ use yii\gii\CodeFile; ...@@ -70,7 +81,7 @@ use yii\gii\CodeFile;
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <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>
<div class="modal-body"> <div class="modal-body">
<p>Please wait ...</p> <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