Skip to content

Commit

Permalink
#9453 Initial Boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Jan 17, 2024
1 parent 7d59a9e commit bce6816
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions classes/template/PKPTemplateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,18 @@ public function display($template = null, $cache_id = null, $compile_id = null,
$output .= 'pkp.const = ' . json_encode($this->_constants) . ';';
}

// add apiBaselUrl for useApiUrl composable
$dispatcher = Application::get()->getDispatcher();
$request = Application::get()->getRequest();
$context = $request->getContext();

$pageContext = [
'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context->getPath())
];
$output .= 'pkp.context = ' . json_encode($pageContext) . ';';



// Load current user data
if (Application::isInstalled()) {
$user = $this->_request->getUser();
Expand Down
21 changes: 21 additions & 0 deletions pages/reviewer/PKPReviewerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use APP\template\TemplateManager;
use Exception;
use Illuminate\Support\Facades\Mail;
use PKP\config\Config;
use PKP\core\JSONMessage;
use PKP\core\PKPApplication;
use PKP\core\PKPRequest;
Expand Down Expand Up @@ -65,6 +66,26 @@ public function submission(array $args, PKPRequest $request): void
'submission' => $reviewSubmission,
]);

$templateMgr->setState([
'isReviewRoundHistoryEnabled' => Config::getVar('features', 'enable_review_round_history'),
'pageInitConfig' => [
'reviewRoundHistories' => [
[
'submissionId' => $reviewSubmission->getId(),
// Just as example, not real data
'reviewRoundId' => 0,
'reviewRoundNumber' => 1
],
[
'submissionId' => $reviewSubmission->getId(),
// Just as example, not real data
'reviewRoundId' => 1,
'reviewRoundNumber' => 2
]
]
]
]);

$templateMgr->display('reviewer/review/reviewStepHeader.tpl');
}

Expand Down
3 changes: 3 additions & 0 deletions templates/reviewer/review/reviewStepHeader.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
{$pageTitle}
</h1>

<!-- rest of this template will be moved inside this component in future -->
<reviewer-submission-page v-if="isReviewRoundHistoryEnabled" v-bind="pageInitConfig"></reviewer-submission-page>

<script type="text/javascript">
// Attach the JS file tab handler.
$(function() {ldelim}
Expand Down

0 comments on commit bce6816

Please sign in to comment.