<?php
namespace zin;

global $lang;
$job        = data('job');
$repo       = data('repo');
$jenkins    = data('jenkins');
$branch     = data('branch');
$configPath = data('configPath');

$appendHtml = '';
if($branch)     $appendHtml .= "<tr><th class=\"py-1.5 pr-2 font-normal nowrap text-right\">{$lang->job->branch}</th><td class=\"py-1.5 pl-2 w-full\">{$branch}</td></tr>";
if($configPath) $appendHtml .= "<tr><th class=\"py-1.5 pr-2 font-normal nowrap text-right\">{$lang->job->yamlPath}</th><td class=\"py-1.5 pl-2 w-full\">{$configPath}</td></tr>";
jsVar('appendHtml', $appendHtml);

if($job->engine != 'jenkins') $job->pipeline = $repo->name;
query('#jobServer')->replaceWith(span(setID('jobServer'), urldecode($job->pipeline) . '@' . $jenkins->name));
