pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
308 stars 447 forks source link

Add skip-to links for content in default frontend templates #1762

Closed NateWr closed 7 years ago

NateWr commented 8 years ago

Default frontend templates should include hidden skip-to links so that screen readers and keyboard users can quickly jump to the primary navigation menus, main content and sidebar.

NateWr commented 8 years ago

PRs (tests running): https://github.com/pkp/pkp-lib/pull/1936 https://github.com/pkp/ojs/pull/1079 https://github.com/pkp/omp/pull/344

NateWr commented 8 years ago

@asmecher The OJS tests for this failed on the same unrelated test as #1765. I've restarted the tests to see if it was a one-off, but do we maybe have tests failing in master at the moment?

asmecher commented 8 years ago

I'll check and see.

asmecher commented 8 years ago

@NateWr, it looks like there was an accidental submodule add at the end of https://github.com/pkp/pkp-lib/commit/d61cc9f2da653346845e1ca1a287c4cae714dc8d -- I've removed it and committed submodule updates to the apps. Will see if that fixes things.

asmecher commented 8 years ago

Yup, that did it! Mind rebasing, @NateWr?

NateWr commented 8 years ago

I think this one is ready for code review. Just one of the tests failed, but it failed during a test that shouldn't involve any of these templates so I think it was a fluke. They're re-running just to check.

@bozana would you do code review?

bozana commented 8 years ago

@NateWr, cool work! :-) I don't know why the OJS tests are failing :-( -- it is case for other PRs as well... I think you will have to rebase and correct the submodule update commits, but then you can merge... THANKS!

NateWr commented 7 years ago

Ok. Rebased and tests are running again. :)

bozana commented 7 years ago

All merged... :-) Thanks!!!

NateWr commented 7 years ago

@asmecher I cherry-picked this into ojs-stable-3_0_0. I tried to cherry-pick it into omp-stable-1_2_0 and omp-dev-1_2, but ran into a conflict:

{**
 * lib/pkp/templates/frontend/components/header.tpl
 *
 * Copyright (c) 2014-2016 Simon Fraser University Library
 * Copyright (c) 2003-2016 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @brief Common frontend site header.
 *
 * @uses $isFullWidth bool Should this page be displayed without sidebars? This
 *       represents a page-level override, and doesn't indicate whether or not
 *       sidebars have been configured for thesite.
 *}

{* Determine whether a logo or title string is being displayed *}
{assign var="showingLogo" value=true}
{if $displayPageHeaderTitle && !$displayPageHeaderLogo && is_string($displayPageHeaderTitle)}
        {assign var="showingLogo" value=false}
{/if}

<!DOCTYPE html>
<html lang="{$currentLocale|replace:"_":"-"}" xml:lang="{$currentLocale|replace:"_":"-"}">
{if !$pageTitleTranslated}{translate|assign:"pageTitleTranslated" key=$pageTitle}{/if}
{include file="frontend/components/headerHead.tpl"}
<body class="pkp_page_{$requestedPage|escape|default:"index"} pkp_op_{$requestedOp|escape|default:"index"}{if $showingLogo} has_site_logo{/if}">
<<<<<<< HEAD
        <script type="text/javascript">
                // Initialise JS handler.
                $(function() {ldelim}
                        $('body').pkpHandler(
                                '$.pkp.controllers.SiteHandler',
                                {ldelim}
                                        {if $isUserLoggedIn}
                                                inlineHelpState: {$initialHelpState},
                                        {/if}
                                        toggleHelpUrl: {url|json_encode page="user" op="toggleHelp" escape=false},
                                        toggleHelpOnText: {$toggleHelpOnText|json_encode},
                                        toggleHelpOffText: {$toggleHelpOffText|json_encode},
                                        {include file="core:controllers/notification/notificationOptions.tpl"}
                                {rdelim});
                {rdelim});
        </script>
=======

        <div class="cmp_skip_to_content">
                <a href="#pkp_content_main">{translate key="navigation.skip.main"}</a>
                <a href="#pkp_content_nav">{translate key="navigation.skip.nav"}</a>
                <a href="#pkp_content_footer">{translate key="navigation.skip.footer"}</a>
        </div>
>>>>>>> 4cf3c50... pkp/pkp-lib#1762 Add skip-to links for keyboard and screen-reader users
        <div class="pkp_structure_page">

That suggests that those two branches are missing some pretty critical commits from way, way back. That SiteHandler stuff was removed when we disconnected the frontend from the backend JS library.

To be honest, I don't feel like I have any sense of how these other branches have diverged from master. When I cherry-pick in, it feels like I'm pushing code with no checks on whether it's working or not...

asmecher commented 7 years ago

Since this isn't a critical bugfix, and since we're releasing OJS 3.0.1 from master fairly soon, feel free to leave this one unported if it's going to take much investigation.

NateWr commented 7 years ago

Ok, closing this issue then.

amandasramalho commented 7 years ago

I'm not sure if it's in this topic that I should insert this, but if it is not, let me know that I'll open another ticket. We updated the OMP for the new version that we downloaded from the link: http://pkp.sfu.ca/omp/download/omp-3.1.0.tar.gz. But the header of the homepage appeared with some strange information. image

Log error: [Wed Jul 12 16:17:22.468668 2017] [:error] [pid 86] [client 192.168.1.91:25189] PHP Strict Standards: Declaration of LanguageToggleBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /var/www/omp/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 0, referer: http://192.168.1.149:53655/index.php/EditoraUNESP/login

[Wed Jul 12 16:17:22.468695 2017] [:error] [pid 86] [client 192.168.1.91:25189] PHP Strict Standards: Declaration of LanguageToggleBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /var/www/omp/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 0, referer: http://192.168.1.149:53655/index.php/EditoraUNESP/login

[Wed Jul 12 16:17:38.587257 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315

[Wed Jul 12 16:17:38.588397 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114

[Wed Jul 12 16:17:38.588589 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315

[Wed Jul 12 16:17:38.589693 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114

[Wed Jul 12 16:17:38.592884 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Strict Standards: Declaration of PKPLoginHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /var/www/omp/lib/pkp/pages/login/PKPLoginHandler.inc.php on line 19

[Wed Jul 12 16:17:38.592957 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Strict Standards: Declaration of LoginHandler::_setMailFrom() should be compatible with PKPLoginHandler::_setMailFrom($request, $mail, $site) in /var/www/omp/pages/login/LoginHandler.inc.php on line 18

[Wed Jul 12 16:17:38.622204 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/plugins/ThemePlugin.inc.php on line 409

[Wed Jul 12 16:17:38.622247 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /var/www/omp/classes/core/Request.inc.php on line 69

[Wed Jul 12 16:17:38.646185 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Strict Standards: Declaration of LanguageToggleBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /var/www/omp/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 20

[Wed Jul 12 16:17:38.646246 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Strict Standards: Declaration of LanguageToggleBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /var/www/omp/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 20

[Wed Jul 12 16:17:38.646264 2017] [:error] [pid 89] [client 192.168.1.91:58818] PHP Strict Standards: Declaration of LanguageToggleBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /var/www/omp/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 20

[Wed Jul 12 16:17:45.246688 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315

[Wed Jul 12 16:17:45.247703 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114

[Wed Jul 12 16:17:45.247886 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315

[Wed Jul 12 16:17:45.249087 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114

[Wed Jul 12 16:17:45.249400 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Strict Standards: Declaration of PKPLoginHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /var/www/omp/lib/pkp/pages/login/PKPLoginHandler.inc.php on line 19

[Wed Jul 12 16:17:45.249480 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Strict Standards: Declaration of LoginHandler::_setMailFrom() should be compatible with PKPLoginHandler::_setMailFrom($request, $mail, $site) in /var/www/omp/pages/login/LoginHandler.inc.php on line 18

[Wed Jul 12 16:17:45.269942 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in /var/www/omp/lib/pkp/classes/plugins/ThemePlugin.inc.php on line 409

[Wed Jul 12 16:17:45.270033 2017] [:error] [pid 53] [client 192.168.1.91:40110] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /var/www/omp/classes/core/Request.inc.php on line 69

asmecher commented 7 years ago

@amandasramalho, if you're not sure where to post a question/issue, try starting with the support forum: http://forum.pkp.sfu.ca/