Updated template

This commit is contained in:
Jeroen De Meerleer 2018-08-31 11:42:52 +02:00
parent 890c392bcf
commit 2dbbb2b0cb
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 8 additions and 1 deletions

View File

@ -36,8 +36,10 @@ if ($jobnameResult[0]["user"] != $_SESSION["userID"]) {
$jobName = $jobnameResult[0]['name'];
$runsForJobQry = "SELECT runs.*, jobs.name FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?";
$allruns = true;
if(!isset($_GET['allruns']) || $_GET['allruns'] == 1) {
$runsForJobQry .= " AND runs.statuscode = jobs.expected";
$allruns = false;
}
$runsForJob = $db->prepare($runsForJobQry);
$runsForJob->execute(array($_GET['jobID']));
@ -59,7 +61,7 @@ foreach($runsForJobResult as $key=>$value) {
$count++;
}
$twig_vars = array('runs' => $runsForJobRendered, "title" => $jobName);
$twig_vars = array('jobID' => $_GET['jobID'], 'runs' => $runsForJobRendered, 'allruns' => $allruns, "title" => $jobName);
//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here'));
echo $twig->render('runs.html.twig', $twig_vars);

View File

@ -2,6 +2,11 @@
{% block title %}Overview of run for {{ title }}{% endblock %}
{% block content %}
<h2>Overview of runs for {{ title }}</h2>
{% if allruns %}
<p><a href="runs.php?jobID={{ jobID }}&allruns=0">Only show failed runs</a></p>
{% elseif not allruns %}
<p><a href="runs.php?jobID={{ jobID }}&allruns=1">Only all failed runs</a></p>
{% endif %}
<div id="accordion" class="panel-group">
{% for run in runs %}
<div class="panel panel-default">