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>
|
||||
178
src/PHPCensor/View/BuildStatus/view.phtml
Normal file
178
src/PHPCensor/View/BuildStatus/view.phtml
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php print $project->getTitle(); ?> - PHP Censor</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link href='//fonts.googleapis.com/css?family=Roboto:300,500&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo PHPCI_URL ?>assets/css/bootstrap.min.css">
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo PHPCI_URL ?>favicon.ico">
|
||||
<link rel="shortcut icon" type="image/png" href="<?php echo PHPCI_URL ?>assets/img/favicon.png">
|
||||
|
||||
<script>window.PHPCI_URL = <?php print json_encode(PHPCI_URL) ?></script>
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
|
||||
<script src="<?php echo PHPCI_URL ?>assets/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo PHPCI_URL ?>assets/js/jqueryui.js"></script>
|
||||
<script src="<?php echo PHPCI_URL ?>assets/js/class.js"></script>
|
||||
<script src="<?php echo PHPCI_URL ?>assets/js/phpci.js"></script>
|
||||
<script src="<?php echo PHPCI_URL ?>assets/js/init.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="<?php echo PHPCI_URL ?>"><img src="<?php echo PHPCI_URL ?>assets/img/php-censor-logo.png"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="content" class="container">
|
||||
|
||||
<h1><?php print $project->getTitle(); ?></h1>
|
||||
<?php if (!empty($latest)): ?>
|
||||
|
||||
<?php
|
||||
|
||||
$statusClass = null;
|
||||
$statusText = null;
|
||||
|
||||
switch ($latest->getStatus()) {
|
||||
case 0:
|
||||
$statusClass = 'info';
|
||||
$statusText = 'Pending';
|
||||
break;
|
||||
case 1:
|
||||
$statusClass = 'warning';
|
||||
$statusText = 'Running';
|
||||
break;
|
||||
case 2:
|
||||
$statusClass = 'success';
|
||||
$statusText = 'Success';
|
||||
break;
|
||||
case 3:
|
||||
$statusClass = 'danger';
|
||||
$statusText = 'Failed';
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- Latest Build -->
|
||||
<div class="build-info-panel panel panel-<?php print $statusClass; ?>">
|
||||
<img class="pull-left" src="//www.gravatar.com/avatar/<?php print md5($latest->getCommitterEmail()); ?>?d=mm">
|
||||
|
||||
<div class="box-header">
|
||||
<h1 class="box-title">
|
||||
<a href="/project/view/<?php print $latest->getProjectId(); ?>">
|
||||
<?php print $latest->getProject()->getTitle(); ?></a>
|
||||
<span>#<?php print $latest->getId(); ?></span>
|
||||
|
||||
<label class="pull-right label label-<?php print $statusClass; ?>"><?php print $statusText; ?></label>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div id="build-info">
|
||||
<?php if ($latest->getCommitMessage()): ?>
|
||||
<div class="commit-message">
|
||||
<?php print $latest->getCommitMessage(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<strong>Branch: </strong> <?php print $latest->getBranch(); ?><br>
|
||||
<strong>Committer: </strong> <?php print $latest->getCommitterEmail(); ?>
|
||||
|
||||
<?php if ($latest->getCommitId() != 'Manual'): ?>
|
||||
<br><strong>Commit ID: </strong> <?php print $latest->getCommitId(); ?><br>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<!-- Recent builds: -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header"><h3 class="box-title">Builds</h3></div>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Commit</th>
|
||||
<th>Branch</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="latest-builds">
|
||||
|
||||
|
||||
<?php if(empty($builds) || !count($builds)): ?>
|
||||
<tr class="">
|
||||
<td colspan="6">No builds yet.</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach($builds as $build): ?>
|
||||
|
||||
<?php
|
||||
switch($build->getStatus())
|
||||
{
|
||||
case 0:
|
||||
$cls = 'active';
|
||||
$subcls = 'info';
|
||||
$status = 'Pending';
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$cls = 'warning';
|
||||
$subcls = 'warning';
|
||||
$status = 'Running';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$cls = 'success';
|
||||
$subcls = 'success';
|
||||
$status = 'Success';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$cls = 'danger';
|
||||
$subcls = 'danger';
|
||||
$status = 'Failed';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<tr class="<?php print $cls; ?>">
|
||||
<td>#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
if ($build->getCommitId() !== 'Manual') {
|
||||
print '<a href="' . $build->getCommitLink() . '">';
|
||||
}
|
||||
print $build->getCommitId();
|
||||
if ($build->getCommitId() !== 'Manual') {
|
||||
print '</a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td><a href="<?php print $build->getBranchLink(); ?>"><?php print $build->getBranch(); ?></a></td>
|
||||
<td>
|
||||
<span class='label label-<?php echo $subcls ?>'><?php echo $status ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
87
src/PHPCensor/View/BuildsTable.phtml
Normal file
87
src/PHPCensor/View/BuildsTable.phtml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
|
||||
<?php if(empty($builds) || !count($builds)): ?>
|
||||
<tr class="">
|
||||
<td colspan="6"><?php Lang::out('no_builds_yet'); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach($builds as $build): ?>
|
||||
|
||||
<?php
|
||||
switch($build->getStatus())
|
||||
{
|
||||
case 0:
|
||||
$cls = 'active';
|
||||
$subcls = 'info';
|
||||
$status = Lang::get('pending');
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$cls = 'warning';
|
||||
$subcls = 'warning';
|
||||
$status = Lang::get('running');
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$cls = 'success';
|
||||
$subcls = 'success';
|
||||
$status = Lang::get('success');
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$cls = 'danger';
|
||||
$subcls = 'danger';
|
||||
$status = Lang::get('failed');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<tr class="<?php print $cls; ?>">
|
||||
<td><a href="<?php echo PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
|
||||
<td><?php print $build->getCreated()->format('Y-m-d H:i:s'); ?></td>
|
||||
<td><a href="<?php echo PHPCI_URL ?>project/view/<?php print $build->getProjectId(); ?>">
|
||||
<i class="fa fa-<?php print $build->getProject()->getIcon(); ?>"></i>
|
||||
|
||||
<?php
|
||||
if (is_object($build->getProject())) {
|
||||
print htmlspecialchars($build->getProject()->getTitle());
|
||||
} else {
|
||||
print ' - ';
|
||||
}
|
||||
?></a></td>
|
||||
|
||||
<td class="hidden-md hidden-sm hidden-xs">
|
||||
<?php
|
||||
if ($build->getCommitId() !== 'Manual') {
|
||||
print sprintf(
|
||||
'<a href="%s" target="_blank">%s (%s)</a>',
|
||||
$build->getCommitLink(),
|
||||
substr($build->getCommitId(), 0, 7),
|
||||
$build->getCommitterEmail()
|
||||
);
|
||||
} else {
|
||||
print Lang::get('manual_build');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td><a href="<?php print $build->getBranchLink(); ?>" target="_blank"><?php print $build->getBranch(); ?></a></td>
|
||||
<td>
|
||||
<span class='label label-<?php echo $subcls ?>'><?php echo $status ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-default btn-sm" href="<?php echo PHPCI_URL ?>build/view/<?php print $build->getId(); ?>"><?php Lang::out('view'); ?></a>
|
||||
<?php if($this->User()->getIsAdmin()): ?>
|
||||
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>" class="phpci-app-delete-build"><?php Lang::out('delete_build'); ?></a></li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
28
src/PHPCensor/View/Email/layout.phtml
Normal file
28
src/PHPCensor/View/Email/layout.phtml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
<?php include(__DIR__ . '/../../../../public/assets/css/ansi-colors.css'); ?>
|
||||
body { font-family: arial, verdana, sans-serif; font-size: 15px; }
|
||||
header { font-size: 25px; margin-bottom: 15px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="background: #<?php print $build->isSuccessful() ? '090' : '900'; ?>; padding: 25px;">
|
||||
<div style="background: #fff; padding: 15px; border-radius: 5px">
|
||||
<header><?php print $project->getTitle(); ?> - Build #<?php print $build->getId(); ?></header>
|
||||
<div>
|
||||
<p>
|
||||
Your commit <strong><?php print $build->getCommitId(); ?></strong> generated a
|
||||
<?php print $build->isSuccessful() ? 'successful' : 'failed'; ?> build in project
|
||||
<strong><?php print $project->getTitle(); ?></strong>.
|
||||
</p>
|
||||
<?php print $content; ?>
|
||||
</div>
|
||||
<footer>
|
||||
You can review <a href="<?php print $build->getCommitLink(); ?>">your commit</a>
|
||||
and the <a href="<?php print PHPCI_URL . 'build/view/' . $build->getId(); ?>">build log</a>.
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
2
src/PHPCensor/View/Email/long.phtml
Normal file
2
src/PHPCensor/View/Email/long.phtml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<p style="margin: 10px; background: #fafafa"><?php print $build->getCommitMessage(); ?></p>
|
||||
<pre class="ansi_color_bg_black ansi_color_fg_white" style="padding: 4px"><?php print \PHPCensor\Helper\AnsiConverter::convert($build->getLog()); ?></pre>
|
||||
1
src/PHPCensor/View/Email/short.phtml
Normal file
1
src/PHPCensor/View/Email/short.phtml
Normal file
|
|
@ -0,0 +1 @@
|
|||
<p style="margin: 10px; background: #fafafa"><?php print $build->getCommitMessage(); ?></p>
|
||||
10
src/PHPCensor/View/Group/edit.phtml
Normal file
10
src/PHPCensor/View/Group/edit.phtml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('group_add_edit'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<?php print $form; ?>
|
||||
</div>
|
||||
</div>
|
||||
41
src/PHPCensor/View/Group/index.phtml
Normal file
41
src/PHPCensor/View/Group/index.phtml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<div class="clearfix" style="margin-bottom: 20px;">
|
||||
<a class="btn btn-success pull-right" href="<?php print PHPCI_URL . 'group/edit'; ?>">
|
||||
<?php Lang::out('group_add'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('project_groups'); ?></h3>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('group_title'); ?></th>
|
||||
<th style="width: 100px;"><?php Lang::out('group_projects'); ?></th>
|
||||
<th style="width: 150px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($groups as $group): ?>
|
||||
<tr>
|
||||
<td><?php print $group['title']; ?></td>
|
||||
<td><?php print count($group['projects']); ?></td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-default" href="<?php print PHPCI_URL . 'group/edit/' . $group['id']; ?>">
|
||||
<?php Lang::out('group_edit'); ?>
|
||||
</a>
|
||||
|
||||
<?php if (!count($group['projects'])): ?>
|
||||
<a class="btn btn-sm btn-danger delete-group" href="<?php print PHPCI_URL . 'group/delete/' . $group['id']; ?>">
|
||||
<?php Lang::out('group_delete'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
116
src/PHPCensor/View/Home/index.phtml
Normal file
116
src/PHPCensor/View/Home/index.phtml
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-5">
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php print $group['title']; ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<?php print $group['summary']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-7 pull-left">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('latest_builds'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<ul class="timeline">
|
||||
<?php $last = new \DateTime('-1 Year'); ?>
|
||||
|
||||
<?php
|
||||
foreach ($builds as $build):
|
||||
switch ($build->getStatus()) {
|
||||
case \PHPCensor\Model\Build::STATUS_NEW:
|
||||
$updated = $build->getCreated();
|
||||
$label = Lang::get('pending');
|
||||
$color = 'blue';
|
||||
break;
|
||||
|
||||
case \PHPCensor\Model\Build::STATUS_RUNNING:
|
||||
$updated = $build->getStarted();
|
||||
$label = Lang::get('running');
|
||||
$color = 'yellow';
|
||||
break;
|
||||
|
||||
case \PHPCensor\Model\Build::STATUS_SUCCESS:
|
||||
$updated = $build->getFinished();
|
||||
$label = Lang::get('successful');
|
||||
$color = 'green';
|
||||
break;
|
||||
|
||||
case \PHPCensor\Model\Build::STATUS_FAILED:
|
||||
$updated = $build->getFinished();
|
||||
$label = Lang::get('failed');
|
||||
$color = 'red';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$updated) {
|
||||
$updated = $build->getCreated();
|
||||
}
|
||||
|
||||
if ($updated->format('Y-m-d') != $last->format('Y-m-d')): $last = $updated;
|
||||
?>
|
||||
<li class="time-label">
|
||||
<span class="bg-gray">
|
||||
<?php print Lang::formatDateTime($last, 'll'); ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- /.timeline-label -->
|
||||
<!-- timeline item -->
|
||||
<li>
|
||||
<i class="fa fa-<?php print $build->getProject()->getIcon(); ?> bg-<?php print $color; ?>"></i>
|
||||
<div class="timeline-item">
|
||||
<span class="time"><i class="fa fa-clock-o"></i> <?php print Lang::formatDateTime($updated, 'LT'); ?></span>
|
||||
<h3 class="timeline-header">
|
||||
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $build->getProjectId(); ?>">
|
||||
<?php print $build->getProject()->getTitle(); ?>
|
||||
</a>
|
||||
-
|
||||
<a href="<?php print PHPCI_URL; ?>build/view/<?php print $build->getId(); ?>">
|
||||
Build #<?php print $build->getId(); ?>
|
||||
</a>
|
||||
-
|
||||
<?php print $label; ?>
|
||||
</h3>
|
||||
|
||||
<div class="timeline-body">
|
||||
<?php
|
||||
if ($build->getCommitId() !== 'Manual') {
|
||||
print sprintf(
|
||||
'<a href="%s" target="_blank">%s (%s)</a>',
|
||||
$build->getCommitLink(),
|
||||
substr($build->getCommitId(), 0, 7),
|
||||
$build->getCommitterEmail()
|
||||
);
|
||||
} else {
|
||||
print Lang::get('manual_build');
|
||||
}
|
||||
?>
|
||||
- <?php print $build->getCommitMessage(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- END timeline item -->
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
<li>
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
64
src/PHPCensor/View/Plugin/index.phtml
Normal file
64
src/PHPCensor/View/Plugin/index.phtml
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<p><strong>Adding requirements to the PHP Censor composer.json file is no longer recommended as a method of installing your required testing tools.</strong><br>
|
||||
For this reason, we have removed the ability for PHP Censor to modify the composer.json file for you.
|
||||
We recommend that you install testing tools using your project's own composer.json file, by adding them to the "require-dev" section of the file.</p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('enabled_plugins'); ?></h3>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('name'); ?></th>
|
||||
<th><?php Lang::out('class'); ?></th>
|
||||
<th><?php Lang::out('provided_by_package'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($plugins as $plugin): ?>
|
||||
<tr>
|
||||
<td><?php print $plugin->name; ?></td>
|
||||
<td><?php print $plugin->class; ?></td>
|
||||
<td><?php print $plugin->source; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('installed_packages'); ?></h3>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('title'); ?></th>
|
||||
<th><?php Lang::out('version'); ?></th>
|
||||
<th width="1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($installedPackages as $package => $version): ?>
|
||||
<tr>
|
||||
<td><?php echo $package; ?></td>
|
||||
<td><?php echo $version; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
164
src/PHPCensor/View/Project/view.phtml
Normal file
164
src/PHPCensor/View/Project/view.phtml
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<script>
|
||||
var PHPCI_PROJECT_ID = <?php print $project->getId(); ?>;
|
||||
var PHPCI_PROJECT_BRANCH = '<?php print $branch; ?>';
|
||||
</script>
|
||||
|
||||
<div class="clearfix" style="margin-bottom: 20px;">
|
||||
<a class="btn btn-default" href="<?php print PHPCI_URL . 'project/edit/' . $project->getId(); ?>">
|
||||
<?php Lang::out('edit_project'); ?>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-danger" href="javascript:confirmDelete('<?php print PHPCI_URL . 'project/delete/' . $project->getId(); ?>', '<?php print Lang::out('project'); ?>', true)">
|
||||
<?php Lang::out('delete_project'); ?>
|
||||
</a>
|
||||
|
||||
<div class="pull-right btn-group">
|
||||
<a class="btn btn-success" href="<?php print PHPCI_URL . 'project/build/' . $project->getId(); ?><?php echo !empty($branch) ? '/' . urlencode($branch) : '' ?>">
|
||||
<?php Lang::out('build_now'); ?>
|
||||
</a>
|
||||
|
||||
<div class="btn-group branch-btn pull-right">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<?php print !empty($branch) ? Lang::get('branch_x', $branch) : Lang::get('branch'); ?> <span class="caret"></span>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<?php foreach ($branches as $curbranch) : ?>
|
||||
<li <?php echo ($curbranch == $branch) ? 'class="active"' : ''?>>
|
||||
<a href="<?php echo PHPCI_URL ?>project/view/<?php print $project->getId(); ?>?branch=<?php echo urlencode($curbranch) ?>">
|
||||
<?php echo $curbranch ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<li class="divider"></li>
|
||||
<li><a href="<?php echo PHPCI_URL ?>project/view/<?php print $project->getId(); ?>"><?php Lang::out('all_branches'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-md-8 col-sm-8">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('builds'); ?> (<?php print $total; ?>)</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('id'); ?></th>
|
||||
<th><?php Lang::out('date'); ?></th>
|
||||
<th><?php Lang::out('project'); ?></th>
|
||||
<th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th>
|
||||
<th><?php Lang::out('branch'); ?></th>
|
||||
<th><?php Lang::out('status'); ?></th>
|
||||
<th style="width: 100px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="latest-builds">
|
||||
<?php print $builds; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-md-4 col-sm-4">
|
||||
|
||||
<?php if (in_array($project->getType(), ['github', 'gitlab', 'bitbucket'])): ?>
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h4 class="box-title"><?php Lang::out('webhooks'); ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<?php
|
||||
switch($project->getType())
|
||||
{
|
||||
case 'github':
|
||||
$url = PHPCI_URL . 'webhook/github/' . $project->getId();
|
||||
Lang::out('webhooks_help_github', $project->getReference());
|
||||
break;
|
||||
|
||||
case 'gitlab':
|
||||
$url = PHPCI_URL. 'webhook/gitlab/' . $project->getId();
|
||||
Lang::out('webhooks_help_gitlab');
|
||||
break;
|
||||
|
||||
case 'bitbucket':
|
||||
$url = PHPCI_URL . 'webhook/bitbucket/' . $project->getId();
|
||||
Lang::out('webhooks_help_bitbucket', $project->getReference());
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<br><br><strong style="word-wrap: break-word;"><?php print $url; ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($project->getSshPublicKey()): ?>
|
||||
<div class="box box-info">
|
||||
<div class="box-header"><h3 class="box-title"><a data-toggle="collapse" data-parent="#accordion" href="#publicCollapse"><?php Lang::out('public_key'); ?></a></h3></div>
|
||||
<div class="box-body" style="word-break: break-all;"><?php print $project->getSshPublicKey(); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
print '<div><ul class="pagination">';
|
||||
|
||||
$project_url = PHPCI_URL . 'project/view/' . $project->getId() . ((!empty($branch)) ? '/' . urlencode($branch) : '');
|
||||
|
||||
if ($page > 1) {
|
||||
print '<li><a href="' . $project_url . '?p='.($page == 1 ? '1' : $page - 1).'">'.Lang::get('prev_link').'</a></li>';
|
||||
}
|
||||
|
||||
if ($pages > 1) {
|
||||
|
||||
$start = $page - 3;
|
||||
|
||||
if ($start <= 0) {
|
||||
$start = 1;
|
||||
}
|
||||
|
||||
$end = $page + 3;
|
||||
|
||||
if ($end > $pages) {
|
||||
$end = $pages;
|
||||
}
|
||||
|
||||
if ($start > 1) {
|
||||
print '<li><a href="' . $project_url . '">1...</a></li>';
|
||||
}
|
||||
|
||||
for($i = $start; $i <= $end; $i++)
|
||||
{
|
||||
if ($pages > $end && $i == $pages) continue;
|
||||
|
||||
if ($i == $page) {
|
||||
print '<li class="bg-blue"><span>' . $i . '</span></li>';
|
||||
} else {
|
||||
print '<li><a href="' . $project_url . '?p=' . $i . '">' . $i . '</a></li>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($pages > $end) {
|
||||
print '<li><a href="' . $project_url . '?p='.$pages.'">...'.$pages.'</a></li>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($page < $pages - 1) {
|
||||
print '<li><a href="' . $project_url . '?p='.($page == $pages ? $pages : $page + 1).'">'.Lang::get('next_link').'</a></li>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '</ul></div>';
|
||||
|
||||
?>
|
||||
46
src/PHPCensor/View/ProjectForm.phtml
Normal file
46
src/PHPCensor/View/ProjectForm.phtml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('project_details'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<?php print $form; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(!is_null($key)): ?>
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-info">
|
||||
<div class="box-body">
|
||||
<p><?php Lang::out('public_key_help'); ?></p>
|
||||
|
||||
<textarea style="width: 90%; height: 150px;"><?php print $key ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.return_url = <?php print json_encode((empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?>;
|
||||
|
||||
<?php
|
||||
$gh = \b8\Config::getInstance()->get('phpci.github', null);
|
||||
|
||||
if($gh) {
|
||||
print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL;
|
||||
}
|
||||
|
||||
if(!empty($token)) {
|
||||
print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
|
||||
$(document).ready(setupProjectForm);
|
||||
</script>
|
||||
59
src/PHPCensor/View/Session.phtml
Normal file
59
src/PHPCensor/View/Session.phtml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><?php Lang::out('log_in_to_phpci'); ?></title>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
html {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
background: #224466;
|
||||
min-height: 100%;
|
||||
font-family: Roboto, Arial, Sans-Serif;
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
#login-box
|
||||
{
|
||||
background: #fcfcfc;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 30px rgba(0,0,0, 0.3);
|
||||
margin: 0 auto;
|
||||
padding: 15px 30px;
|
||||
text-align: left;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#phpci-logo img {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row" style="margin-top: 10%; text-align: center">
|
||||
<a id="phpci-logo" href="/">
|
||||
<img src="<?php print PHPCI_URL; ?>assets/img/php-censor-logo.png">
|
||||
</a>
|
||||
<div class="" id="login-box">
|
||||
<?php print $content; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
31
src/PHPCensor/View/Session/forgotPassword.phtml
Normal file
31
src/PHPCensor/View/Session/forgotPassword.phtml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<?php if (isset($emailed)): ?>
|
||||
<p class="alert alert-success" style="margin-bottom: 0">
|
||||
<?php Lang::out('reset_emailed'); ?>
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<?php if (empty($error)): ?>
|
||||
<div class="" style="margin-bottom: 15px;">
|
||||
<?php Lang::out('reset_header'); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-danger">
|
||||
<?php print $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="">
|
||||
<form class="form" action="<?php print PHPCI_URL; ?>session/forgot-password" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="email"><?php Lang::out('reset_email_address'); ?></label>
|
||||
<input id="email" name="email" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input class="btn btn-success" type="submit" value="<?php Lang::out('reset_send_email'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
9
src/PHPCensor/View/Session/login.phtml
Normal file
9
src/PHPCensor/View/Session/login.phtml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<?php if($failed): ?>
|
||||
<p class="alert alert-danger"><?php Lang::out('login_error'); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php print $form; ?>
|
||||
|
||||
<a style="margin-top: -22px; font-size: 0.85em; color: #246" class="pull-right" href="<?php print PHPCI_URL; ?>session/forgot-password">
|
||||
<?php Lang::out('forgotten_password_link'); ?>
|
||||
</a>
|
||||
26
src/PHPCensor/View/Session/resetPassword.phtml
Normal file
26
src/PHPCensor/View/Session/resetPassword.phtml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<?php if (empty($error)): ?>
|
||||
|
||||
<div class="box-header">
|
||||
<?php Lang::out('reset_enter_password'); ?>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<form class="form" action="<?php print PHPCI_URL; ?>session/reset-password/<?php print $id; ?>/<?php print $key; ?>" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="password"><?php Lang::out('reset_new_password'); ?></label>
|
||||
<input type="password" id="password" name="password" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input class="btn btn-success" type="submit" value="<?php Lang::out('reset_change_password'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="alert alert-danger" style="margin-bottom: 0">
|
||||
<?php print $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
132
src/PHPCensor/View/Settings/index.phtml
Normal file
132
src/PHPCensor/View/Settings/index.phtml
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
|
||||
<?php if (isset($_GET['saved']) && $_GET['saved'] == 1): ?>
|
||||
<p class="alert alert-success" style="margin-bottom: 20px;">
|
||||
<?php Lang::out('settings_saved'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_GET['saved']) && $_GET['saved'] == 2): ?>
|
||||
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
||||
<?php Lang::out('settings_check_perms'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$isWriteable): ?>
|
||||
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
||||
<?php Lang::out('settings_cannot_write'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_GET['linked']) && $_GET['linked'] == 1): ?>
|
||||
<p class="alert alert-success" style="margin-bottom: 20px;">
|
||||
<?php Lang::out('settings_github_linked'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_GET['linked']) && $_GET['linked'] == 2): ?>
|
||||
<p class="alert alert-danger" style="margin-bottom: 20px;">
|
||||
<?php Lang::out('settings_github_not_linked'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-body clearfix">
|
||||
<?php print $basicSettings; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header"><h3 class="box-title"><?php Lang::out('build_settings'); ?></h3></div>
|
||||
<div class="box-body clearfix">
|
||||
<?php print $buildSettings; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header"><h3 class="box-title"><?php Lang::out('github_application'); ?></h3></div>
|
||||
<div class="box-body clearfix">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<?php
|
||||
$id = null;
|
||||
|
||||
if (isset($settings['phpci']['github']['id'])) {
|
||||
$id = $settings['phpci']['github']['id'];
|
||||
}
|
||||
|
||||
$returnTo = PHPCI_URL . 'settings/github-callback';
|
||||
$githubUri = 'https://github.com/login/oauth/authorize?client_id='.$id.'&scope=repo&redirect_uri=' . $returnTo;
|
||||
?>
|
||||
<?php if (!empty($id)): ?>
|
||||
<?php if (empty($githubUser['name']) || empty($settings['phpci']['github']['token'])): ?>
|
||||
<p class="alert alert-warning clearfix">
|
||||
<?php Lang::out('github_sign_in', $githubUri); ?>
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<p class="alert alert-success">
|
||||
<?php Lang::out('github_phpci_linked'); ?>
|
||||
|
||||
<strong>
|
||||
<a href="<?php echo $githubUser['html_url']; ?>"><?php echo $githubUser['name']; ?></a>
|
||||
</strong>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8">
|
||||
<?php print $github; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('github_where_to_find'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<p>
|
||||
<?php Lang::out('github_where_help'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('email_settings'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body clearfix">
|
||||
<?php if (!isset($settings['phpci']['email_settings'])): ?>
|
||||
<p class="alert alert-warning clearfix">
|
||||
<?php Lang::out('email_settings_help'); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php print $emailSettings; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Authentication Settings</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body clearfix">
|
||||
<p class="alert alert-warning clearfix">
|
||||
Be careful: This setting disables authentication and uses your current admin account for all actions within phpci with admin rights.
|
||||
</p>
|
||||
|
||||
<?php print $authenticationSettings; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
135
src/PHPCensor/View/SummaryTable.phtml
Normal file
135
src/PHPCensor/View/SummaryTable.phtml
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
use PHPCensor\Helper\Lang;
|
||||
|
||||
foreach($projects as $project):
|
||||
$statuses = [];
|
||||
$failures = 0;
|
||||
$subcls = 'yellow';
|
||||
$cls = '';
|
||||
$success = null;
|
||||
$failure = null;
|
||||
|
||||
if (count($builds[$project->getId()])) {
|
||||
// Get the most recent build status to determine the main block colour.
|
||||
$last_build = $builds[$project->getId()][0];
|
||||
$status = $last_build->getStatus();
|
||||
switch($status) {
|
||||
case 0:
|
||||
$subcls = 'blue';
|
||||
break;
|
||||
case 1:
|
||||
$subcls = 'yellow';
|
||||
break;
|
||||
case 2:
|
||||
$subcls = 'green';
|
||||
break;
|
||||
case 3:
|
||||
$subcls = 'red';
|
||||
break;
|
||||
}
|
||||
// Use the last 5 builds to determine project health:
|
||||
$failures = 0;
|
||||
|
||||
foreach ($builds[$project->getId()] as $build) {
|
||||
switch ($build->getStatus()) {
|
||||
case 0:
|
||||
$statuses[] = 'pending';
|
||||
break;
|
||||
case 1:
|
||||
$statuses[] = 'running';
|
||||
break;
|
||||
case 2:
|
||||
$statuses[] = 'ok';
|
||||
$success = is_null($success) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $success;
|
||||
break;
|
||||
case 3:
|
||||
$failures++;
|
||||
$statuses[] = 'failed';
|
||||
$failure = is_null($failure) && !is_null($build->getFinished()) ? Lang::formatDateTime($build->getFinished()) : $failure;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$buildCount = count($builds[$project->getId()]);
|
||||
$lastSuccess = $successful[$project->getId()];
|
||||
$lastFailure = $failed[$project->getId()];
|
||||
$message = Lang::get('no_builds_yet');
|
||||
$shortMessage = Lang::get('no_builds_yet');
|
||||
|
||||
if ($buildCount > 0) {
|
||||
if ($failures > 0) {
|
||||
$shortMessage = Lang::get('x_of_x_failed_short', $failures, $buildCount);
|
||||
$message = Lang::get('x_of_x_failed', $failures, $buildCount);
|
||||
|
||||
if (!is_null($lastSuccess) && !is_null($lastSuccess->getFinished())) {
|
||||
$message .= Lang::get('last_successful_build', Lang::formatDateTime($lastSuccess->getFinished()));
|
||||
} else {
|
||||
$message .= Lang::get('never_built_successfully');
|
||||
}
|
||||
} else {
|
||||
$message = Lang::get('all_builds_passed', $buildCount);
|
||||
$shortMessage = Lang::get('all_builds_passed_short', $buildCount, $buildCount);
|
||||
|
||||
if (!is_null($lastFailure) && !is_null($lastFailure->getFinished())) {
|
||||
$message .= Lang::get('last_failed_build', Lang::formatDateTime($lastFailure->getFinished()));
|
||||
} else {
|
||||
$message .= Lang::get('never_failed_build');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="small-box small-box-full bg-<?php print $subcls; ?>">
|
||||
|
||||
<div class="inner">
|
||||
<h3>
|
||||
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $project->getId(); ?>">
|
||||
<?php print $project->getTitle(); ?>
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
<?php print $message; ?>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fa fa-<?php print $project->getIcon(); ?>"></i>
|
||||
</div>
|
||||
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $project->getId(); ?>" class="small-box-footer small-box-footer-project">
|
||||
<?php Lang::out('view_project'); ?> (<?php print $counts[$project->getId()]; ?>) <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
|
||||
<?php for ($idx=0; $idx < 5; $idx++) {
|
||||
if (empty($builds[$project->getId()][$idx])) {
|
||||
echo '<span class="small-box-footer-build small-box-footer bg-blue"><i class="fa fa-minus"></i></span>';
|
||||
} else {
|
||||
$build = $builds[$project->getId()][$idx];
|
||||
$link = PHPCI_URL . 'build/view/' . $build->id;
|
||||
switch ($build->getStatus()) {
|
||||
case 0:
|
||||
$class = 'bg-blue';
|
||||
$icon = 'fa-minus';
|
||||
break;
|
||||
case 1:
|
||||
$class = 'bg-yellow';
|
||||
$icon = 'fa-clock-o';
|
||||
break;
|
||||
case 2:
|
||||
$class = 'bg-green';
|
||||
$icon = 'fa-check';
|
||||
break;
|
||||
case 3:
|
||||
$class = 'bg-red';
|
||||
$icon = 'fa-times';
|
||||
break;
|
||||
}
|
||||
echo '<a href="' . $link .'" class="small-box-footer-build small-box-footer ' . $class . '"><i class="fa ' . $icon . '"></i></a>';
|
||||
}
|
||||
} ?>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
61
src/PHPCensor/View/User/index.phtml
Normal file
61
src/PHPCensor/View/User/index.phtml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<div class="clearfix" style="margin-bottom: 20px;">
|
||||
<div class="pull-right btn-group">
|
||||
<a class="btn btn-primary" href="<?php print PHPCI_URL; ?>user/add"><?php Lang::out('add_user'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box box-primary">
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('email_address'); ?></th>
|
||||
<th><?php Lang::out('name'); ?></th>
|
||||
<th><?php Lang::out('is_admin'); ?></th>
|
||||
<th style="width: 100px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="users">
|
||||
<?php foreach($users['items'] as $user): ?>
|
||||
<?php
|
||||
switch($user->getIsAdmin())
|
||||
{
|
||||
case 0:
|
||||
$cls = '';
|
||||
$status = Lang::get('no');
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$cls = 'warning';
|
||||
$status = Lang::get('yes');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<tr class="<?php print $cls; ?>">
|
||||
<td><a href="<?php echo PHPCI_URL ?>user/edit/<?php print $user->getId(); ?>"><?php print $user->getEmail(); ?></a></td>
|
||||
<td><?php print htmlspecialchars($user->getName()); ?></td>
|
||||
<td><?php print $status; ?></td>
|
||||
<td>
|
||||
<?php if($this->User()->getIsAdmin()): ?>
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn btn-default btn-small" href="<?php echo PHPCI_URL ?>user/edit/<?php print $user->getId(); ?>"><?php Lang::out('edit'); ?></a>
|
||||
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo PHPCI_URL ?>user/delete/<?php print $user->getId(); ?>" class="phpci-app-delete-user"><?php Lang::out('delete_user'); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
14
src/PHPCensor/View/User/profile.phtml
Normal file
14
src/PHPCensor/View/User/profile.phtml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<?php if (isset($updated)): ?>
|
||||
<p class="alert alert-success"><?php Lang::out('your_details_updated'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('update_your_details'); ?></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<?php print $form; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
9
src/PHPCensor/View/UserForm.phtml
Normal file
9
src/PHPCensor/View/UserForm.phtml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<?php print $form; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
9
src/PHPCensor/View/exception.phtml
Normal file
9
src/PHPCensor/View/exception.phtml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<div class="panel panel-danger">
|
||||
<div class="box-header">
|
||||
<h2 class="box-title">Sorry, there was a problem</h2>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<?php print $exception->getMessage(); ?>
|
||||
</div>
|
||||
</div>
|
||||
292
src/PHPCensor/View/layout.phtml
Normal file
292
src/PHPCensor/View/layout.phtml
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
<?php use PHPCensor\Helper\Lang; ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?php print $title; ?><?php print !empty($subtitle) ? ' - ' . $subtitle : ''; ?></title>
|
||||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
|
||||
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/ionicons/1.5.2/css/ionicons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="<?php print PHPCI_URL; ?>assets/plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php print PHPCI_URL; ?>assets/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php print PHPCI_URL; ?>assets/css/ansi-colors.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- Theme style -->
|
||||
<link href="<?php print PHPCI_URL; ?>assets/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php print PHPCI_URL; ?>assets/css/AdminLTE-skins.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php print PHPCI_URL; ?>assets/css/AdminLTE-custom.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<script>
|
||||
var PHPCI_URL = '<?php print PHPCI_URL; ?>';
|
||||
var PHPCI_LANGUAGE = <?php print json_encode(Lang::getLanguage()); ?>;
|
||||
|
||||
<?php if (defined('JSON_UNESCAPED_UNICODE')): ?>
|
||||
var PHPCI_STRINGS = <?php print json_encode(Lang::getStrings(), JSON_UNESCAPED_UNICODE); ?>;
|
||||
<?php else: ?>
|
||||
var PHPCI_STRINGS = <?php print json_encode(Lang::getStrings()); ?>;
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/class.js"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/sprintf.js"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/moment.min.js"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/phpci.js" type="text/javascript"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="phpci <?php print !empty($skin) ? 'skin-' . $skin : 'skin-blue'; ?>">
|
||||
<div class="wrapper row-offcanvas row-offcanvas-left">
|
||||
|
||||
<!-- header logo: style can be found in header.less -->
|
||||
<header class="main-header">
|
||||
<a href="<?php print PHPCI_URL; ?>" class="logo">PHPCI</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
|
||||
<span class="sr-only"><?php Lang::out('toggle_navigation'); ?></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="dropdown messages-menu phpci-pending">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
<span class="label label-info phpci-pending-count"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><?php Lang::out('n_builds_pending', 0); ?></li>
|
||||
<li>
|
||||
<ul class="menu phpci-pending-list">
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown messages-menu phpci-running">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-cogs"></i>
|
||||
<span class="label label-warning phpci-running-count"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header"><?php Lang::out('n_builds_running', 0); ?></li>
|
||||
<li>
|
||||
<ul class="menu phpci-running-list">
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<?php if (!$this->LoginIsDisabled()->check()): ?>
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="glyphicon glyphicon-user"></i>
|
||||
<span><?php print $this->User()->getName(); ?> <i class="caret"></i></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header bg-light-blue">
|
||||
<img src="https://www.gravatar.com/avatar/<?php print md5($this->User()->getEmail()); ?>?d=mm" class="img-circle" alt="<?php print $this->User()->getName(); ?>" />
|
||||
<p>
|
||||
<?php print $this->User()->getName(); ?>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="<?php print PHPCI_URL ?>user/profile" class="btn btn-default btn-flat"><?php Lang::out('edit_profile'); ?></a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="<?php print PHPCI_URL ?>session/logout" class="btn btn-default btn-flat"><?php Lang::out('sign_out'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar sidebar-offcanvas">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
|
||||
<?php if (!$this->LoginIsDisabled()->check()): ?>
|
||||
<!-- Sidebar user panel -->
|
||||
<div class="user-panel">
|
||||
<div class="pull-left image">
|
||||
<img src="https://www.gravatar.com/avatar/<?php print md5($this->User()->getEmail()); ?>?d=mm" class="img-circle" alt="<?php print $this->User()->getName(); ?>" />
|
||||
</div>
|
||||
<div class="pull-left info">
|
||||
<p><?php Lang::out('hello_name', $this->User()->getName()); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu">
|
||||
<li<?php print (array_key_exists('archived', $_GET) ? '' : ' class="active"'); ?>>
|
||||
<a href="<?php print PHPCI_URL; ?>">
|
||||
<i class="fa fa-dashboard"></i> <span><?php Lang::out('dashboard'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if ($this->User()->getIsAdmin()): ?>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-edit"></i>
|
||||
<span><?php Lang::out('admin_options'); ?></span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
|
||||
<ul class="treeview-menu">
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>project/add">
|
||||
<i class="fa fa-angle-double-right"></i> <?php Lang::out('add_project'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>group">
|
||||
<i class="fa fa-angle-double-right"></i> <?php Lang::out('project_groups'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>settings">
|
||||
<i class="fa fa-angle-double-right"></i> <?php Lang::out('settings'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>user">
|
||||
<i class="fa fa-angle-double-right"></i> <?php Lang::out('manage_users'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>plugin">
|
||||
<i class="fa fa-angle-double-right"></i> <?php Lang::out('plugins'); ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-folder"></i>
|
||||
<span><?php print $group['title']; ?></span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
|
||||
<?php if (count($group['projects'])): ?>
|
||||
<ul class="treeview-menu">
|
||||
<?php foreach($group['projects'] as $project): ?>
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $project->getId(); ?>">
|
||||
<i class="fa fa-<?php print $project->getIcon(); ?>"></i>
|
||||
<span><?php print $project->getTitle(); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if (isset($nav)): ?>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-<?php print $nav['icon']; ?>"></i>
|
||||
<span><?php print $nav['title']; ?></span>
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</a>
|
||||
|
||||
<ul class="treeview-menu">
|
||||
<?php foreach ($nav['links'] as $link => $linkTitle): ?>
|
||||
<li>
|
||||
<a href="<?php print PHPCI_URL . $link; ?>">
|
||||
<i class="fa fa-angle-double-right"></i> <?php print $linkTitle; ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="archive<?php print (array_key_exists('archived', $_GET) ? ' active' : ''); ?>">
|
||||
<a href="<?php print PHPCI_URL . (array_key_exists('archived', $_GET) ? '' : '?archived'); ?>">
|
||||
<i class="fa fa-archive"></i> <span><?php Lang::out('archived_menu'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Right side column. Contains the navbar and content of the page -->
|
||||
<aside class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<div class="pull-right">
|
||||
<?php print (!empty($actions) ? $actions : ''); ?>
|
||||
</div>
|
||||
|
||||
<h1>
|
||||
<?php print !empty($title) ? $title : 'PHP Censor'; ?>
|
||||
|
||||
<?php if (!empty($subtitle)): ?>
|
||||
<small><?php print $subtitle; ?></small>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<?php
|
||||
if (!empty($_SESSION['global_error'])) {
|
||||
$message = $_SESSION['global_error'];
|
||||
unset($_SESSION['global_error']);
|
||||
print '<div class="alert alert-danger">' . $message . '</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php print $content; ?>
|
||||
</section><!-- /.content -->
|
||||
</aside><!-- /.content-wrapper -->
|
||||
</div><!-- ./wrapper -->
|
||||
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
|
||||
|
||||
<script src="<?php print PHPCI_URL; ?>assets/plugins/chartjs/Chart.min.js" type="text/javascript"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/plugins/datepicker/bootstrap-datepicker.js" type="text/javascript"></script>
|
||||
<?php if (file_exists(PHPCI_PUBLIC_DIR . 'assets/plugins/datepicker/locales/bootstrap-datepicker.' . Lang::getLanguage() . '.js')) :?>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/plugins/datepicker/locales/bootstrap-datepicker.<?php print Lang::getLanguage(); ?>.js" type="text/javascript"></script>
|
||||
<?php endif; ?>
|
||||
<script src="<?php print PHPCI_URL; ?>assets/js/AdminLTE/app.min.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue