<?php
namespace zin;

global $app, $lang;
$mr = data('MR');
if($app->rawModule == 'pullreq')
{
    $targetBranch = data('targetBranch');
    query('#mrJob')->remove();
    query('#mrBranches')->remove();
    query('.mr-status-tr')->before(
        h::tr
        (
            h::th
            (
                setClass('py-1.5 pr-2 font-normal nowrap text-right'),
                $lang->pullreq->pushBranch
            ),
            h::td
            (
                setClass('py-1.5 pl-2 w-full'),
                h::a
                (
                    setClass('font-normal'),
                    set::href($targetBranch),
                    set::target('_blank'),
                    $mr->targetBranch
                )
            )
        )
    );
}

$systemServer = $app->control->loadModel('instance')->getSystemServer();
if($systemServer && $systemServer->id == $mr->hostID) query('.detail-header')->find('.gray-pale')->remove();
