diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04a3f65..e8bd6a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,5 +6,5 @@ include: ref: main file: - 'templates/groups/pkp_plugin.yml' - - 'templates/groups/ojs_3_4_plugins_cypress_tests_model.yml' + - 'templates/groups/ojs/cypress_tests.yml' diff --git a/AuthorAndSectionSearchFiltersPlugin.php b/AuthorAndSectionSearchFiltersPlugin.php index 8074290..5320d85 100644 --- a/AuthorAndSectionSearchFiltersPlugin.php +++ b/AuthorAndSectionSearchFiltersPlugin.php @@ -60,7 +60,10 @@ public function replaceAuthorsFilter($hookName, $params) public function replaceAuthorsInputFieldFilter($output, $templateMgr): string { - $pattern = '/]+>/'; + $context = Application::get()->getRequest()->getContext(); + $pattern = '/]+>/'; + $templateName = $context->getData('themePluginPath') == "classic" ? + 'newAuthorsFilterClassicTheme.tpl' : 'newAuthorsFilter.tpl'; if (preg_match($pattern, $output, $matches, PREG_OFFSET_CAPTURE)) { $match = $matches[0][0]; @@ -68,7 +71,7 @@ public function replaceAuthorsInputFieldFilter($output, $templateMgr): string $templateMgr->assign('authorsList', $this->loadAuthors()); $newOutput = substr($output, 0, $offset); - $newOutput .= $templateMgr->fetch($this->getTemplateResource('newAuthorsFilter.tpl')); + $newOutput .= $templateMgr->fetch($this->getTemplateResource($templateName)); $newOutput .= substr($output, $offset + strlen($match)); $output = $newOutput; @@ -117,7 +120,12 @@ public function createSectionsSearchFilter($hookName, $params): bool $templateMgr->addStyleSheet('sectionSearchFilter', $styleUrl, ['contexts' => 'frontend']); $templateMgr->assign('sectionsList', $this->loadSections()); - $output .= $templateMgr->fetch($this->getTemplateResource('sectionSearchFilter.tpl')); + + $context = Application::get()->getRequest()->getContext(); + $templateName = $context->getData('themePluginPath') == "classic" ? + 'sectionSearchFilterClassicTheme.tpl' : 'sectionSearchFilter.tpl'; + + $output .= $templateMgr->fetch($this->getTemplateResource($templateName)); return false; } diff --git a/styles/sectionFilter.css b/styles/sectionFilter.css index 47b1bb3..a7651f7 100644 --- a/styles/sectionFilter.css +++ b/styles/sectionFilter.css @@ -12,4 +12,8 @@ width: 50%; margin-top: 1.43rem; } +} + +#authorsClassicTheme, #sectionsClassicTheme { + width: -webkit-fill-available; } \ No newline at end of file diff --git a/templates/newAuthorsFilterClassicTheme.tpl b/templates/newAuthorsFilterClassicTheme.tpl new file mode 100644 index 0000000..d72ba13 --- /dev/null +++ b/templates/newAuthorsFilterClassicTheme.tpl @@ -0,0 +1,5 @@ +