Skip to content

Commit

Permalink
Merge branch 'release-15.15.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 1, 2024
2 parents e7f459b + 00c7704 commit acbca04
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 29 deletions.
70 changes: 44 additions & 26 deletions controller/DeliveryServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,32 +116,7 @@ public function index()
}
$this->setData('availableDeliveries', $deliveryData);

/**
* Header & footer info
*/
$this->setData('showControls', $this->showControls());
$this->setData('userLabel', tao_helpers_Display::htmlEscape($session->getUserLabel()));

// Require JS config
$this->setData('client_config_url', $this->getClientConfigUrl());
$this->setData('client_timeout', $this->getClientTimeout());

$loaderRenderer = new \Renderer(Template::getTemplate('DeliveryServer/blocks/loader.tpl', 'taoDelivery'));
$loaderRenderer->setData('client_config_url', $this->getClientConfigUrl());
$loaderRenderer->setData('parameters', ['messages' => $this->getViewDataFromRequest()]);

/* @var $urlRouteService DefaultUrlService */
$urlRouteService = $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID);
$this->setData('logout', $urlRouteService->getUrl('logoutDelivery', []));

/**
* Layout template + real template inclusion
*/
$this->setData('additional-header', $loaderRenderer);
$this->setData('content-template', 'DeliveryServer/index.tpl');
$this->setData('content-extension', 'taoDelivery');
$this->setData('title', __('TAO: Test Selection'));
$this->setView('DeliveryServer/layout.tpl', 'taoDelivery');
$this->setTemplate('DeliveryServer/index.tpl', __('TAO: Test Selection'));
}

/**
Expand Down Expand Up @@ -245,6 +220,17 @@ public function initDeliveryExecution(): void
*/
public function runDeliveryExecution(): void
{
if ($this->hasGetParameter('waitingPage')) {
$this->setData('delivery-execution-url', $this->getGetParameter('deliveryExecutionUrl'));
$this->setData('block-title', __('Authorized, you may proceed'));
$this->setData('scope', 'waiting-page');
$this->setData('hideHomeButton', true);
$this->setData('hideLogoutButton', true);
$this->setTemplate('DeliveryServer/waiting_page.tpl', __('Waiting page'));

return;
}

$deliveryExecution = $this->getCurrentDeliveryExecution();

if (!in_array($deliveryExecution->getState()->getUri(), $this->getDeliveryServer()->getResumableStates())) {
Expand Down Expand Up @@ -345,6 +331,38 @@ public function finishDeliveryExecution()
$this->redirect($this->getReturnUrl());
}

private function setTemplate(string $template, string $title)
{
$session = common_session_SessionManager::getSession();

/**
* Header & footer info
*/
$this->setData('showControls', $this->showControls());
$this->setData('userLabel', tao_helpers_Display::htmlEscape($session->getUserLabel()));

// Require JS config
$this->setData('client_config_url', $this->getClientConfigUrl());
$this->setData('client_timeout', $this->getClientTimeout());

$loaderRenderer = new \Renderer(Template::getTemplate('DeliveryServer/blocks/loader.tpl', 'taoDelivery'));
$loaderRenderer->setData('client_config_url', $this->getClientConfigUrl());
$loaderRenderer->setData('parameters', ['messages' => $this->getViewDataFromRequest()]);

/* @var $urlRouteService DefaultUrlService */
$urlRouteService = $this->getServiceManager()->get(DefaultUrlService::SERVICE_ID);
$this->setData('logout', $urlRouteService->getUrl('logoutDelivery', []));

/**
* Layout template + real template inclusion
*/
$this->setData('additional-header', $loaderRenderer);
$this->setData('content-template', $template);
$this->setData('content-extension', 'taoDelivery');
$this->setData('title', $title);
$this->setView('DeliveryServer/layout.tpl', 'taoDelivery');
}

/**
* Initialize the result server using the delivery configuration and for this results session submission
*
Expand Down
2 changes: 1 addition & 1 deletion views/css/delivery.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/css/delivery.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions views/scss/delivery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,12 @@ html {
}
}
}

}

.waiting-page {
.content-wrap{
display: flex;
flex-direction: column;
}
}
2 changes: 1 addition & 1 deletion views/templates/DeliveryServer/layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use oat\tao\model\theme\Theme;
? get_data('additional-header')->render()
: '' ?>
</head>
<body class="delivery-scope">
<body class="delivery-scope <?= get_data('scope') ?>">
<?php Template::inc('blocks/requirement-check.tpl', 'tao'); ?>

<div class="content-wrap<?php if (!get_data('showControls')) :?> no-controls<?php endif; ?>">
Expand Down
14 changes: 14 additions & 0 deletions views/templates/DeliveryServer/waiting_page.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<main class="test-listing">
<ul class="entry-point-box plain">
<li>
<div class="block entry-point entry-point-all-deliveries" data-launch_url="<?= get_data('delivery-execution-url') ?>" tabindex="-1">
<h3><?= _dh(get_data('block-title')) ?></h3>
<div class="clearfix">
<span class="action" tabindex="0" role="button" aria-label="<?= __('Start this test') ?>">
<span class="icon-play"></span> <?= __('Start') ?>
</span>
</div>
</div>
</li>
</ul>
</main>

0 comments on commit acbca04

Please sign in to comment.