Skip to content

Commit bce6816

Browse files
#9453 Initial Boilerplate
1 parent 7d59a9e commit bce6816

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

classes/template/PKPTemplateManager.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,6 +1210,18 @@ public function display($template = null, $cache_id = null, $compile_id = null,
12101210
$output .= 'pkp.const = ' . json_encode($this->_constants) . ';';
12111211
}
12121212

1213+
// add apiBaselUrl for useApiUrl composable
1214+
$dispatcher = Application::get()->getDispatcher();
1215+
$request = Application::get()->getRequest();
1216+
$context = $request->getContext();
1217+
1218+
$pageContext = [
1219+
'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context->getPath())
1220+
];
1221+
$output .= 'pkp.context = ' . json_encode($pageContext) . ';';
1222+
1223+
1224+
12131225
// Load current user data
12141226
if (Application::isInstalled()) {
12151227
$user = $this->_request->getUser();

pages/reviewer/PKPReviewerHandler.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use APP\template\TemplateManager;
2424
use Exception;
2525
use Illuminate\Support\Facades\Mail;
26+
use PKP\config\Config;
2627
use PKP\core\JSONMessage;
2728
use PKP\core\PKPApplication;
2829
use PKP\core\PKPRequest;
@@ -65,6 +66,26 @@ public function submission(array $args, PKPRequest $request): void
6566
'submission' => $reviewSubmission,
6667
]);
6768

69+
$templateMgr->setState([
70+
'isReviewRoundHistoryEnabled' => Config::getVar('features', 'enable_review_round_history'),
71+
'pageInitConfig' => [
72+
'reviewRoundHistories' => [
73+
[
74+
'submissionId' => $reviewSubmission->getId(),
75+
// Just as example, not real data
76+
'reviewRoundId' => 0,
77+
'reviewRoundNumber' => 1
78+
],
79+
[
80+
'submissionId' => $reviewSubmission->getId(),
81+
// Just as example, not real data
82+
'reviewRoundId' => 1,
83+
'reviewRoundNumber' => 2
84+
]
85+
]
86+
]
87+
]);
88+
6889
$templateMgr->display('reviewer/review/reviewStepHeader.tpl');
6990
}
7091

templates/reviewer/review/reviewStepHeader.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{$pageTitle}
1515
</h1>
1616

17+
<!-- rest of this template will be moved inside this component in future -->
18+
<reviewer-submission-page v-if="isReviewRoundHistoryEnabled" v-bind="pageInitConfig"></reviewer-submission-page>
19+
1720
<script type="text/javascript">
1821
// Attach the JS file tab handler.
1922
$(function() {ldelim}

0 commit comments

Comments
 (0)