Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ajustes de acessibilidade. Remoção de ids desnecessários, altera… #142

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 5 additions & 35 deletions opac/webapp/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,51 +132,21 @@ var Portal = {
}
});

/* 2023 - instancia o slick slider - cards home */
function updateAccessibility(slick, currentSlide) {
// Remover tabindex e aria-hidden de todos os slides
slick.$slides.each(function(index, element){
$(element).attr('tabindex', '-1').attr('aria-hidden', 'true');
});

// Calcular quais slides são completamente visíveis
var visibleSlides = [];
slick.$slides.each(function(index, element){
var $element = $(element);
var elementLeft = $element.offset().left;
var elementRight = elementLeft + $element.outerWidth();
var sliderLeft = slick.$slider.offset().left;
var sliderRight = sliderLeft + slick.$slider.outerWidth();

// Checar se o slide está completamente visível
if (elementLeft >= sliderLeft && elementRight <= sliderRight) {
visibleSlides.push($element);
}
});

// Ajustar os atributos de acessibilidade dos slides visíveis
$(visibleSlides).each(function(index, element){
$(element).attr('tabindex', '0').attr('aria-hidden', 'false');
});
}

$('.scielo-slider').on('init reInit afterChange', function(event, slick, currentSlide){
updateAccessibility(slick, currentSlide);
});

$('.scielo-slider').slick({
'focusOnChange': false,
'slidesToShow': 3.5,
'slidesToShow': 4,
'infinite': false,
'centerPadding': '0',
'arrows': true,
'dots': true,
'slidesToScroll': 3,
'slidesToScroll': 4,
'responsive': [
{
'breakpoint': 767,
'settings': {
'dots': true,
'slidesToShow': 1.2,
'slidesToShow': 1,
'slidesToScroll': 1,
'centerMode': false,
'arrows': false,
Expand All @@ -187,7 +157,7 @@ var Portal = {
'breakpoint': 992,
'settings': {
'dots': true,
'slidesToShow': 2.2,
'slidesToShow': 2,
'slidesToScroll': 2,
'centerMode': false,
'arrows': false,
Expand Down
2 changes: 1 addition & 1 deletion opac/webapp/static/js/scielo-bundle-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion opac/webapp/static/maps/scielo-bundle-min.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion opac/webapp/templates/article/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

{% include "article/includes/header.html" %}

{% include "article/includes/alternative_header.html" %}
<!--- removido da interface --->
{# include "article/includes/alternative_header.html" #}

{% block main_content %}{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ <h2 class="logo-svg">
-->

<div class="dropdown mt-3">
<button class="btn btn-link dropdown-toggle mb-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-link dropdown-toggle mb-0" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down Expand Up @@ -262,10 +262,10 @@ <h2 class="logo-svg">
<div class="row d-block d-sm-none">
<div class="col">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu w-100" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu w-100">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down
8 changes: 4 additions & 4 deletions opac/webapp/templates/article/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
</div>
<div class="d-none d-sm-block col">
<div class="dropdown mt-3">
<button class="btn btn-link dropdown-toggle mb-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-link dropdown-toggle mb-0" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="text-truncate scielo__truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu scielo__shadow-2" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu scielo__shadow-2">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down Expand Up @@ -103,10 +103,10 @@
<div class="row d-block d-sm-none">
<div class="col">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu w-100" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu w-100">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down
8 changes: 4 additions & 4 deletions opac/webapp/templates/collection/includes/levelMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<ol class="breadcrumb mb-0 ps-0">
<li class="breadcrumb-item">
<a href="{{ url_for('.index') }}"><a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a></a>
<a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a>
</li>
<li class="breadcrumb-item">
{% trans %}Sobre o SciELO{% endtrans %} {{ coll_macro.get_collection_name() }}
Expand All @@ -32,7 +32,7 @@

<ol class="breadcrumb mb-0 ps-0">
<li class="breadcrumb-item">
<a href="{{ url_for('.index') }}"><a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a></a>
<a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a>
</li>
<li class="breadcrumb-item">
{% trans %}Periódicos{% endtrans %}
Expand Down Expand Up @@ -74,7 +74,7 @@

<ol class="breadcrumb mb-0 ps-0">
<li class="breadcrumb-item">
<a href="{{ url_for('.index') }}"><a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a></a>
<a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a>
</li>
<li class="breadcrumb-item">
{% trans %}Sobre o SciELO{% endtrans %} {{ coll_macro.get_collection_name() }}
Expand All @@ -85,7 +85,7 @@

<ol class="breadcrumb mb-0 ps-0">
<li class="breadcrumb-item">
<a href="{{ url_for('.index') }}"><a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a></a>
<a href="{{ url_for('.index') }}" alt="{% trans %}Home{% endtrans %}"><span class="material-icons-outlined">home</span></a>
</li>
<li class="breadcrumb-item">
{% trans %}Periódicos{% endtrans %}
Expand Down
2 changes: 1 addition & 1 deletion opac/webapp/templates/collection/includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<nav>
<ul>
<li>
<a href="{{ url_for('.index') }}" alt="{% trans %}Acessar site coleção Brasil{% endtrans %}" aria-label="{% trans %}Acesse o SciELO{% endtrans %}">
<a href="{{ url_for('.index') }}" alt="{% trans %}Acessar site coleção{% endtrans %} {{ coll_macro.get_collection_name() }}" aria-label="{% trans %}Acessar site coleção{% endtrans %} {{ coll_macro.get_collection_name() }}">
<strong>{{ coll_macro.get_collection_name() }}</strong>
</a>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion opac/webapp/templates/collection/list_journal.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<section class="collection collectionList">
<div class="container">

<h3 class="h4 mb-3"> {% trans %}Periódicos{% endtrans %}</h3>
<h1 class="h4 mb-3"> {% trans %}Periódicos{% endtrans %}</h1>

<ul class="nav nav-tabs">
<li class="nav-item">
Expand Down
4 changes: 2 additions & 2 deletions opac/webapp/templates/includes/language.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<div class="scielo__language">
<div class="dropdown">
<button id="btnGroupDropAppLanguage" type="button" class="btn btn-sm btn-secondary scielo__btn-with-icon--left dropdown-toggle mb-0 float-end mt-1" data-bs-toggle="dropdown" aria-expanded="false">
<button type="button" class="btn btn-sm btn-secondary scielo__btn-with-icon--left dropdown-toggle mb-0 float-end mt-1" data-bs-toggle="dropdown" aria-expanded="false">
<span class="material-icons-outlined">language</span>

{% if session.lang == 'pt_BR' %}
Expand All @@ -20,7 +20,7 @@
{% endif %}

</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="btnGroupDropAppLanguage">
<ul class="dropdown-menu dropdown-menu-end">
{% if session.lang == 'pt_BR' %}
<li><a class="dropdown-item" href="{{ url_for('.set_locale', lang_code='es') }}" lang="es">Español</a></li>
<li><a class="dropdown-item" href="{{ url_for('.set_locale', lang_code='en') }}" lang="en">English</a></li>
Expand Down
4 changes: 2 additions & 2 deletions opac/webapp/templates/includes/share.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- share -->
<div class="dropdown">
<button id="btnGroupDropShare" type="button" class="btn btn-sm btn-secondary scielo__btn-with-icon--only dropdown-toggle mb-0 float-end" data-bs-toggle="dropdown" aria-expanded="false">
<button type="button" class="btn btn-sm btn-secondary scielo__btn-with-icon--only dropdown-toggle mb-0 float-end" data-bs-toggle="dropdown" aria-expanded="false">
<span class="material-icons-outlined">share</span>
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="btnGroupDropShare">
<ul class="dropdown-menu dropdown-menu-end">
<li><a href="javascript:window.print();" class="dropdown-item">{% trans %}Imprimir{% endtrans %}</a></li>
<li><a href="{{ url_for('main.collection_list_feed')}}" type="button" class="dropdown-item" target="_blank">RSS</a></li>
<li><a href="javascript:;" class="dropdown-item share_modal_id">E-mail</a></li>
Expand Down
3 changes: 2 additions & 1 deletion opac/webapp/templates/issue/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ <h3 class="h5">{% trans %}Histórico deste periódico na coleção{% endtrans %}
{% include "journal/includes/contact_footer.html" %}

{% with page='grid' %}
{% include "journal/includes/alternative_header.html" %}
<!--- removido da interface --->
{# include "article/includes/alternative_header.html" #}
{% endwith %}

{% endblock %}
3 changes: 2 additions & 1 deletion opac/webapp/templates/issue/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ <h2 class="h4 d-none">
{% include "journal/includes/contact_footer.html" %}

{% with page='toc' %}
{% include "issue/includes/alternative_header.html" %}
<!--- removido da interface --->
{# include "article/includes/alternative_header.html" #}
{% endwith %}

{% endblock %}
3 changes: 2 additions & 1 deletion opac/webapp/templates/journal/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@

{% include "includes/footer.html" %}

{% include "journal/includes/alternative_header.html" %}
<!--- removido da interface --->
{# include "article/includes/alternative_header.html" #}

{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h2 class="logo-svg-mini">
<span class="logo-collection logo-collection-svg-mini"><strong>{{ coll_macro.get_collection_name() }}</strong></span>
</a>
</h2>
<div class="mainMenu" id="alternativeMainMenu">
<div class="mainMenu">
<div class="row">
<div class="col-md-7 col-md-offset-2 col-sm-7 col-sm-offset-2 logo logo-svg"></div>
</div>
Expand Down Expand Up @@ -132,7 +132,7 @@ <h2 class="logo-svg-mini">
<div class="col-2 mainNav">
<a href="" class="menu" data-rel="#alternativeMainMenu" title="{% trans %}Abrir menu{% endtrans %}"> {% trans %}Abrir menu{% endtrans %}
</a>
<div class="mainMenu" id="alternativeMainMenu">
<div class="mainMenu">
<div class="row">
<div class="col-md-7 col-md-offset-2 col-sm-7 col-sm-offset-2 logo logo-svg"></div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions opac/webapp/templates/journal/includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</div>
<div class="d-none d-sm-block d-lg-none col d-print-none">
<div class="dropdown mt-3">
<button class="btn btn-link dropdown-toggle mb-0" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-link dropdown-toggle mb-0" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="text-truncate scielo__truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu scielo__shadow-2" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu scielo__shadow-2">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down Expand Up @@ -59,10 +59,10 @@
<div class="row d-block d-sm-none">
<div class="col">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
<button class="btn btn-secondary dropdown-toggle mb-2 w-100" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="truncate">{{ journal.title }} </span>
</button>
<ul class="dropdown-menu w-100" aria-labelledby="dropdownMenuButton1">
<ul class="dropdown-menu w-100">
<li>
<a href="{{ url_for('.journal_detail', url_seg=journal.url_segment) }}" class="dropdown-item">
{% if journal.logo_url %}
Expand Down