Fixed namespaces (PHPCI -> PHPCensor)
This commit is contained in:
parent
60d74b0b44
commit
60a2b7282a
238 changed files with 1014 additions and 863 deletions
37
src/PHPCensor/View/Build/errors.phtml
Normal file
37
src/PHPCensor/View/Build/errors.phtml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
use PHPCensor\Helper\Lang;
|
||||
|
||||
$linkTemplate = $build->getFileLinkTemplate();
|
||||
|
||||
/** @var \PHPCI\Model\BuildError $error */
|
||||
foreach ($errors as $error):
|
||||
|
||||
$link = str_replace('{FILE}', $error->getFile(), $linkTemplate);
|
||||
$link = str_replace('{LINE}', $error->getLineStart(), $link);
|
||||
$link = str_replace('{LINE_END}', $error->getLineEnd(), $link);
|
||||
?>
|
||||
|
||||
<tr class="bg-<?php print $error->getSeverityClass(); ?>">
|
||||
<td>
|
||||
<span class="label label-<?php print $error->getSeverityClass(); ?>">
|
||||
<?php print Lang::get($error->getSeverityString()); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php print Lang::get($error->getPlugin()); ?></td>
|
||||
<td><a href="<?php print $link; ?>" target="_blank"><?php print $error->getFile(); ?></a></td>
|
||||
<td>
|
||||
<a href="<?php print $link; ?>" target="_blank">
|
||||
<?php
|
||||
if ($error->getLineStart() == $error->getLineEnd() || !$error->getLineEnd()) {
|
||||
print $error->getLineStart();
|
||||
} else {
|
||||
print $error->getLineStart() . ' - ' . $error->getLineEnd();
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php print $error->getMessage(); ?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
21
src/PHPCensor/View/Build/header-row.phtml
Normal file
21
src/PHPCensor/View/Build/header-row.phtml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>build/view/<?php print $build->getId(); ?>">
|
||||
<?php if ($build->getCommitterEmail()): ?>
|
||||
<div class="pull-left">
|
||||
<img src="https://www.gravatar.com/avatar/<?php print md5($build->getCommitterEmail()); ?>?d=mm&s=40" class="img-circle" alt="">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h4>
|
||||
<?php print $build->getProject()->getTitle(); ?>
|
||||
|
||||
<?php if ($build->getStatus() == \PHPCensor\Model\Build::STATUS_NEW): ?>
|
||||
<small class="pull-right"><?php Lang::out('created_x', $build->getCreated()->format('H:i')); ?></small>
|
||||
<?php elseif ($build->getStatus() == \PHPCensor\Model\Build::STATUS_RUNNING): ?>
|
||||
<small class="pull-right"><?php Lang::out('started_x', $build->getStarted()->format('H:i')); ?></small>
|
||||
<?php endif; ?>
|
||||
</h4>
|
||||
<p><?php Lang::out('branch_x', $build->getBranch()); ?></p>
|
||||
</a>
|
||||
</li>
|
||||
190
src/PHPCensor/View/Build/view.phtml
Normal file
190
src/PHPCensor/View/Build/view.phtml
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
<?php Lang::out('build_details'); ?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><?php Lang::out('project'); ?></th>
|
||||
<td style="text-align: right">
|
||||
<a href="<?php print PHPCI_URL . 'project/view/' . $build->getProjectId(); ?>">
|
||||
<i class="fa fa-<?php print $build->getProject()->getIcon(); ?>"></i>
|
||||
<?php print $build->getProject()->getTitle(); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php Lang::out('branch'); ?></th>
|
||||
<td style="text-align: right">
|
||||
<a target="_blank" href="<?php print $build->getBranchLink(); ?>">
|
||||
<span class="label label-default"><?php print $build->getBranch(); ?></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php Lang::out('duration'); ?></th>
|
||||
<td style="text-align: right" class="build-duration duration" data-duration="<?php print $build->getDuration(); ?>">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
<?php Lang::out('commit_details'); ?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><?php Lang::out('commit'); ?></th>
|
||||
<td style="text-align: right">
|
||||
<a target="_blank" href="<?php print $build->getCommitLink(); ?>">
|
||||
<?php print substr($build->getCommitId(), 0, 7); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php Lang::out('committer'); ?></th>
|
||||
<td style="text-align: right">
|
||||
<?php print $build->getCommitterEmail(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php print $build->getCommitMessage(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
<?php Lang::out('timing'); ?>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body no-padding">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><?php Lang::out('created'); ?></th>
|
||||
<td style="text-align: right" class="build-created datetime" data-date="<?php print $build->getCreated() ? $build->getCreated()->format('Y-m-d H:i:s') : ''; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php Lang::out('started'); ?></th>
|
||||
<td style="text-align: right" class="build-started datetime" data-date="<?php print $build->getStarted() ? $build->getStarted()->format('Y-m-d H:i:s') : ''; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php Lang::out('finished'); ?></th>
|
||||
<td style="text-align: right" class="build-finished datetime" data-date="<?php print $build->getFinished() ? $build->getFinished()->format('Y-m-d H:i:s') : ''; ?>">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#log" data-toggle="tab"><i class="fa fa-cogs"></i> <?php print Lang::get('build_log'); ?></a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#errors" data-toggle="tab">
|
||||
<i class="fa fa-exclamation-triangle"></i> <?php print Lang::get('errors'); ?>
|
||||
<?php if ($data['errors'] == 0): ?>
|
||||
<span class="errors-label label label-danger" style="display: none">0</span>
|
||||
<?php else: ?>
|
||||
<span class="errors-label label label-danger"><?php print $data['errors']; ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a href="#information" data-toggle="tab"><i class="fa fa-info-circle"></i> <?php print Lang::get('information'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="log">
|
||||
<pre style="height: 400px; overflow-y: auto;"><?php print $data['log']; ?></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="errors">
|
||||
<table class="errors-table table table-hover dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('severity'); ?></th>
|
||||
<th><?php Lang::out('plugin'); ?></th>
|
||||
<th><?php Lang::out('file'); ?></th>
|
||||
<th data-orderable="false"><?php Lang::out('line'); ?></th>
|
||||
<th data-orderable="false"><?php Lang::out('message'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php print $data['error_html']; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="information">
|
||||
<div id="plugins" class="row"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/build.js"></script>
|
||||
<script>
|
||||
|
||||
var ActiveBuild = new Build(<?php print $build->getId() ?>);
|
||||
ActiveBuild.setupBuild(<?php print json_encode($data); ?>, <?php print json_encode($build->getFileLinkTemplate()); ?>);
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
foreach ($plugins as $plugin) {
|
||||
print '<script src="'.PHPCI_URL.'assets/js/build-plugins/' . $plugin . '"></script>' . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
ActiveBuild.renderPlugins();
|
||||
|
||||
$('#delete-build').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
confirmDelete(
|
||||
"<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>", "Build"
|
||||
).onCloseConfirmed = function () {window.location = '/'};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue