2017-10-24 16:42:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \JasonGrimes\Paginator $paginator
|
|
|
|
*/
|
|
|
|
|
|
|
|
use PHPCensor\Helper\Lang;
|
|
|
|
|
|
|
|
?>
|
2014-12-02 17:26:55 +01:00
|
|
|
<script>
|
2017-04-09 17:39:20 +02:00
|
|
|
var PROJECT_ID = <?= $project->getId(); ?>;
|
|
|
|
var PROJECT_ENVIRONMENT = '<?= $environment; ?>';
|
|
|
|
var PROJECT_BRANCH = '<?= $branch; ?>';
|
|
|
|
var PER_PAGE = <?= $perPage; ?>;
|
2017-05-08 09:51:32 +02:00
|
|
|
var PAGE = <?= $page; ?>;
|
2014-12-02 17:26:55 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="clearfix" style="margin-bottom: 20px;">
|
2017-04-09 17:39:20 +02:00
|
|
|
<a class="btn btn-default" href="<?= APP_URL . 'project/edit/' . $project->getId(); ?>">
|
2015-10-08 17:33:01 +02:00
|
|
|
<?php Lang::out('edit_project'); ?>
|
|
|
|
</a>
|
|
|
|
|
2017-01-12 17:37:37 +01:00
|
|
|
<a class="btn btn-danger" id="delete-project">
|
2015-10-08 17:33:01 +02:00
|
|
|
<?php Lang::out('delete_project'); ?>
|
|
|
|
</a>
|
|
|
|
|
2017-05-09 06:25:16 +02:00
|
|
|
<?php
|
|
|
|
$build_url = APP_URL . 'project/build/' . $project->getId();
|
|
|
|
?>
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="pull-right btn-group">
|
2017-01-15 16:35:42 +01:00
|
|
|
<?php if (!$project->getArchived()): ?>
|
2018-02-17 05:59:02 +01:00
|
|
|
<?php if ($this->getUser()->getIsAdmin()): ?>
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php if (!empty($environment)): ?>
|
2017-05-09 06:25:16 +02:00
|
|
|
<a class="btn btn-danger" href="<?= $build_url . '?' . http_build_query(['type' => 'environment', 'id' => $environment, 'debug' => 1]); ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now_debug'); ?>
|
|
|
|
</a>
|
|
|
|
<?php elseif (!empty($branch)): ?>
|
2017-05-09 06:25:16 +02:00
|
|
|
<a class="btn btn-danger" href="<?= $build_url . '?' . http_build_query(['type' => 'branch', 'id' => $branch, 'debug' => 1]); ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now_debug'); ?>
|
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
2017-05-09 06:25:16 +02:00
|
|
|
<a class="btn btn-danger" href="<?= $build_url . '?' . http_build_query(['debug' => 1]); ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now_debug'); ?>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
2017-02-18 18:52:13 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php if (!empty($environment)): ?>
|
2017-05-09 06:25:16 +02:00
|
|
|
<a class="btn btn-success" href="<?= $build_url . '?' . http_build_query(['type' => 'environment', 'id' => $environment]); ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now'); ?>
|
|
|
|
</a>
|
|
|
|
<?php elseif (!empty($branch)): ?>
|
2017-05-09 06:25:16 +02:00
|
|
|
<a class="btn btn-success" href="<?= $build_url . '?' . http_build_query(['type' => 'branch', 'id' => $branch]); ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now'); ?>
|
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
2017-06-24 09:28:04 +02:00
|
|
|
<a class="btn btn-success" href="<?= $build_url; ?>">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php Lang::out('build_now'); ?>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
2017-01-15 16:35:42 +01:00
|
|
|
<?php endif; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
|
2017-04-09 17:39:20 +02:00
|
|
|
<div class="btn-group branch-btn pull-right">
|
2014-12-02 17:26:55 +01:00
|
|
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?php if (!empty($environment)) {
|
|
|
|
Lang::out('environment_x', $environment);
|
2017-03-23 13:53:24 +01:00
|
|
|
} elseif (!empty($branch)) {
|
2017-04-09 17:39:20 +02:00
|
|
|
Lang::out('branch_x', $branch);
|
2017-03-23 13:53:24 +01:00
|
|
|
} else {
|
2017-04-09 17:39:20 +02:00
|
|
|
Lang::out('all');
|
|
|
|
} ?> <span class="caret"></span>
|
2014-12-02 17:26:55 +01:00
|
|
|
</button>
|
|
|
|
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
2017-04-09 17:39:20 +02:00
|
|
|
<li><a href="<?= APP_URL; ?>project/view/<?= $project->getId(); ?>"><?php Lang::out('all'); ?></a></li>
|
2017-03-23 13:53:24 +01:00
|
|
|
<li class="divider"></li>
|
|
|
|
|
|
|
|
<?php if(!empty($environments)): ?>
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($environments as $currentEnvironment) : ?>
|
2017-04-09 17:39:20 +02:00
|
|
|
<li <?= ($currentEnvironment == $environment) ? 'class="active"' : ''; ?>>
|
|
|
|
<a href="<?= APP_URL; ?>project/view/<?= $project->getId(); ?>?environment=<?= urlencode($currentEnvironment); ?>">
|
|
|
|
<i class="fa fa-cog"></i><?= $currentEnvironment; ?>
|
2017-03-23 13:53:24 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2017-04-01 06:32:39 +02:00
|
|
|
<?php foreach ($branches as $currentBranch) : ?>
|
2017-04-09 17:39:20 +02:00
|
|
|
<li <?= ($currentBranch == $branch) ? 'class="active"' : ''; ?>>
|
|
|
|
<a href="<?= APP_URL; ?>project/view/<?= $project->getId(); ?>?branch=<?= urlencode($currentBranch); ?>">
|
|
|
|
<i class="fa fa-code-fork"></i><?= $currentBranch; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2014-09-16 13:27:32 +02:00
|
|
|
</div>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2013-05-10 13:28:43 +02:00
|
|
|
|
|
|
|
<div class="row">
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="col-lg-9 col-md-8 col-sm-8">
|
|
|
|
<div class="box">
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-header">
|
2017-04-09 17:39:20 +02:00
|
|
|
<h3 class="box-title"><?php Lang::out('builds'); ?> (<?= $total; ?>)</h3>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2017-02-28 14:28:54 +01:00
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?php Lang::out('id'); ?></th>
|
2017-04-09 17:51:03 +02:00
|
|
|
<th><?php Lang::out('status'); ?></th>
|
2017-02-28 14:28:54 +01:00
|
|
|
<th><?php Lang::out('date'); ?></th>
|
2017-04-13 17:00:29 +02:00
|
|
|
<th><?php Lang::out('build_source'); ?></th>
|
2017-02-28 14:28:54 +01:00
|
|
|
<th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th>
|
|
|
|
<th><?php Lang::out('branch'); ?></th>
|
2017-04-09 17:51:03 +02:00
|
|
|
<th><?php Lang::out('environment'); ?></th>
|
2017-02-28 14:28:54 +01:00
|
|
|
<th><?php Lang::out('duration'); ?></th>
|
2017-12-13 16:40:51 +01:00
|
|
|
<th><?php Lang::out('new_errors'); ?></th>
|
2017-02-28 14:28:54 +01:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody id="latest-builds">
|
2017-04-09 17:39:20 +02:00
|
|
|
<?= $builds; ?>
|
2017-02-28 14:28:54 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2017-10-29 08:06:41 +01:00
|
|
|
<div id="paginator">
|
|
|
|
<?= $paginator; ?>
|
2017-10-24 16:42:18 +02:00
|
|
|
</div>
|
2017-01-06 12:39:04 +01:00
|
|
|
</div>
|
2014-12-02 17:26:55 +01:00
|
|
|
|
|
|
|
<div class="col-lg-3 col-md-4 col-sm-4">
|
2013-05-10 13:28:43 +02:00
|
|
|
|
2017-12-24 06:18:49 +01:00
|
|
|
<?php if ($project->getAllowPublicStatus()): ?>
|
2017-01-14 12:44:57 +01:00
|
|
|
<div class="box">
|
|
|
|
<div class="box-header">
|
|
|
|
<h4 class="box-title"><?= Lang::get('public_status_title'); ?></h4>
|
2017-04-09 03:44:30 +02:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
|
|
|
<i class="fa fa-minus"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
2017-01-14 12:44:57 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="box-body">
|
|
|
|
<span style="word-wrap: break-word;">
|
|
|
|
<a href="<?= APP_URL . 'build-status/view/' . $project->getId() . '?branch=master'; ?>">
|
|
|
|
<img src="<?= APP_URL . 'build-status/image/' . $project->getId() . '?branch=master&label=PHPCensor&style=flat-square'; ?>" />
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<br /><br />
|
|
|
|
<?= Lang::get('public_status_image'); ?>:<br /><strong><?= APP_URL . 'build-status/image/' . $project->getId() . '?branch=master&label=PHPCensor&style=flat-square'; ?></strong>
|
|
|
|
|
|
|
|
<br /><br />
|
|
|
|
<?= Lang::get('public_status_page'); ?>:<br /><strong><?= APP_URL . 'build-status/view/' . $project->getId() . '?branch=master'; ?></strong>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
2016-04-21 06:58:09 +02:00
|
|
|
<?php if (in_array($project->getType(), ['github', 'gitlab', 'bitbucket'])): ?>
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="box">
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-header">
|
2014-12-04 13:19:06 +01:00
|
|
|
<h4 class="box-title"><?php Lang::out('webhooks'); ?></h4>
|
2017-04-09 03:44:30 +02:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
|
|
|
<i class="fa fa-minus"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-12-02 17:26:55 +01:00
|
|
|
<div class="box-body">
|
|
|
|
<?php
|
|
|
|
switch($project->getType())
|
|
|
|
{
|
|
|
|
case 'github':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL . 'webhook/github/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_github', $project->getReference());
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'gitlab':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL. 'webhook/gitlab/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_gitlab');
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'bitbucket':
|
2018-03-08 09:54:19 +01:00
|
|
|
case 'bitbucket-hg':
|
2017-01-14 12:44:57 +01:00
|
|
|
$url = APP_URL . 'webhook/bitbucket/' . $project->getId();
|
2014-12-04 13:19:06 +01:00
|
|
|
Lang::out('webhooks_help_bitbucket', $project->getReference());
|
2014-12-02 17:26:55 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
2017-04-09 17:39:20 +02:00
|
|
|
<br><br><strong style="word-wrap: break-word;"><?= $url; ?></strong>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
2014-05-01 19:00:46 +02:00
|
|
|
<?php endif; ?>
|
2014-04-30 15:13:07 +02:00
|
|
|
|
2014-05-14 10:27:41 +02:00
|
|
|
<?php if ($project->getSshPublicKey()): ?>
|
2017-01-06 12:39:04 +01:00
|
|
|
<div class="box">
|
2017-04-09 03:44:30 +02:00
|
|
|
<div class="box-header">
|
|
|
|
<h3 class="box-title"><?php Lang::out('public_key'); ?></h3>
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
|
|
|
<i class="fa fa-minus"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-09 17:39:20 +02:00
|
|
|
<div class="box-body" style="word-break: break-all;"><?= $project->getSshPublicKey(); ?></div>
|
2014-04-30 15:13:07 +02:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2014-12-02 17:26:55 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2014-09-16 13:27:32 +02:00
|
|
|
|
2017-01-12 17:37:37 +01:00
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$('#delete-project').on('click', function (e) {
|
|
|
|
e.preventDefault();
|
2017-01-14 10:58:55 +01:00
|
|
|
confirmDelete("<?= APP_URL; ?>project/delete/<?= $project->getId(); ?>")
|
|
|
|
.onCloseConfirmed = function () {window.location = '/'};
|
2017-01-12 17:37:37 +01:00
|
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|