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

[FEATURE] improve news list accessibility #343

Merged
merged 2 commits into from
Nov 24, 2017
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
14 changes: 7 additions & 7 deletions Resources/Private/Extensions/News/Partials/List/Item.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
=====================
Partials/List/Item.html
-->
<div class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}" itemscope="itemscope" itemtype="http://schema.org/Article">
<article class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}" itemscope="itemscope" itemtype="http://schema.org/Article">
<n:excludeDisplayedNews newsItem="{newsItem}"/>
<!-- header -->
<div class="news-article-header">
Expand All @@ -17,16 +17,16 @@ <h3>
<!-- media preview element -->
<f:then>
<div class="news-img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<n:link newsItem="{newsItem}" settings="{settings}" title="{f:translate(key:'news.more-link.linktext', extensionName:'Theme_t3kit')}{newsItem.title}">
<f:alias map="{mediaElement: '{newsItem.mediaPreviews.0}'}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:image src="{mediaElement.uid}" class="img-responsive" treatIdAsReference="1" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}"/>
<f:media file="{mediaElement}" width="{settings.list.media.image.maxWidth}"/>
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 4">
<f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}"/>
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 5">
<f:image src="{mediaElement.uid}" class="img-responsive" treatIdAsReference="1" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}"/>
<f:media file="{mediaElement}" width="{settings.list.media.image.maxWidth}"/>
</f:if>
</f:alias>
</n:link>
Expand All @@ -36,7 +36,7 @@ <h3>
<f:if condition="{settings.displayDummyIfNoMedia}">
<div class="news-img-wrap">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<n:link newsItem="{newsItem}" settings="{settings}" title="{f:translate(key:'news.more-link.linktext', extensionName:'Theme_t3kit')}{newsItem.title}">
<f:image src="{settings.list.media.dummyImage}" class="img-responsive" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}"/>
</n:link>
</span>
Expand All @@ -56,7 +56,7 @@ <h3>
</f:else>
</f:if>

<n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{newsItem.title}">
<n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{f:translate(key:'news.more-link.linktext', extensionName:'Theme_t3kit')}{newsItem.title}">
<f:translate key="more-link"/>
</n:link>
</div>
Expand Down Expand Up @@ -94,4 +94,4 @@ <h3>
</f:if>
</p>
</div>
</div>
</article>
12 changes: 8 additions & 4 deletions Resources/Private/Extensions/News/Partials/List/SimpleList.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@
<!-- media preview element -->
<f:then>
<div class="news-simple-list__img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}" title="{newsItem.title}">
<n:link newsItem="{newsItem}" settings="{settings}" title="{f:translate(key:'news.more-link.linktext', extensionName:'Theme_t3kit')}{newsItem.title}">
<f:alias map="{mediaElement: '{newsItem.mediaPreviews.0}'}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<div class="news-simple-list__media-preview" style="background-image:url('{f:uri.image(src: mediaElement.uid, treatIdAsReference: 1)}');"></div>
<div class="news-simple-list__media-preview">
<f:media file="{mediaElement}" width="170"/>
</div>
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 4">
<f:media file="{mediaElement}" additionalConfig="{loop: '0', autoplay: '0'}" />
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 5">
<div class="news-simple-list__media-preview" style="background-image:url('{f:uri.image(src: mediaElement.uid, treatIdAsReference: 1)}');"></div>
<div class="news-simple-list__media-preview">
<f:media file="{mediaElement}" width="170"/>
</div>
</f:if>
</f:alias>
</n:link>
Expand Down Expand Up @@ -89,7 +93,7 @@ <h3>{newsItem.title}</h3>
</div>

<div class="news-simple-list__more-link">
<n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{newsItem.title}">
<n:link newsItem="{newsItem}" settings="{settings}" class="more" title="{f:translate(key:'news.more-link.linktext', extensionName:'Theme_t3kit')}{newsItem.title}">
<f:translate key="more-link"/>
</n:link>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:if condition="{configuration.insertAbove}">
<f:render section="paginator" arguments="{pagination: pagination,configuration:configuration}" />
</f:if>

<f:renderChildren arguments="{contentArguments}" />

<f:if condition="{configuration.insertBelow}">
<f:render section="paginator" arguments="{pagination: pagination,configuration:configuration}" />
</f:if>

<f:section name="paginator">
<f:if condition="{pagination.numberOfPages} > 1">
<f:if condition="{settings.list.paginate}">
<f:if condition="{pagination.previousPage}">
<f:if condition="{pagination.previousPage} > 1">
<f:then>
<n:headerData><link rel="prev" href="{f:widget.uri(arguments: {currentPage: pagination.previousPage}) -> f:format.htmlentities()}" /></n:headerData>
</f:then>
<f:else>
<n:headerData><link rel="prev" href="{f:widget.uri() -> f:format.htmlentities()}" /></n:headerData>
</f:else>
</f:if>
</f:if>
<f:if condition="{pagination.nextPage}">
<n:headerData><link rel="next" href="{f:widget.uri(arguments: {currentPage: pagination.nextPage}) -> f:format.htmlentities()}" /></n:headerData>
</f:if>
</f:if>

<nav aria-label="{f:translate(key:'paginate.list.ariaLabel', extensionName:'Theme_t3kit')}">
<div class="page-navigation">
<p>
<f:translate key="paginate_overall" arguments="{0:pagination.current,1:pagination.numberOfPages}" />
</p>
<ul class="f3-widget-paginator">
<f:if condition="{pagination.previousPage}">
<li class="previous">
<f:if condition="{pagination.previousPage} > 1">
<f:then>
<f:widget.link addQueryStringMethod="GET" arguments="{currentPage: pagination.previousPage}">
<f:translate key="paginate_previous" />
</f:widget.link>
</f:then>
<f:else>
<f:widget.link addQueryStringMethod="GET">
<f:translate key="paginate_previous" />
</f:widget.link>
</f:else>
</f:if>
</li>
</f:if>
<f:if condition="{pagination.displayRangeStart} > 1">
<li class="first">
<f:widget.link addQueryStringMethod="GET">1</f:widget.link>
</li>
</f:if>
<f:if condition="{pagination.hasLessPages}">
<li>....</li>
</f:if>
<f:for each="{pagination.pages}" as="page">
<f:if condition="{page.isCurrent}">
<f:then>
<li class="current">
<span aria-current="true" aria-label="{f:translate(key:'paginate.page.ariaLabel', extensionName:'Theme_t3kit')} {page.number}">{page.number}</span>
</li>
</f:then>
<f:else>
<li>
<f:if condition="{page.number} > 1">
<f:then>
<f:widget.link addQueryStringMethod="GET" arguments="{currentPage: page.number}">{page.number}</f:widget.link>
</f:then>
<f:else>
<f:widget.link addQueryStringMethod="GET">{page.number}</f:widget.link>
</f:else>
</f:if>
</li>
</f:else>
</f:if>
</f:for>
<f:if condition="{pagination.hasMorePages}">
<li>....</li>
</f:if>
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
<li class="last">
<f:widget.link addQueryStringMethod="GET" arguments="{currentPage: pagination.numberOfPages}">{pagination.numberOfPages}</f:widget.link>
</li>
</f:if>
<f:if condition="{pagination.nextPage}">
<li class="last next">
<f:widget.link addQueryStringMethod="GET" arguments="{currentPage: pagination.nextPage}">
<f:translate key="paginate_next" />
</f:widget.link>
</li>
</f:if>
</ul>
</div>
<div class="news-clear"></div>
</nav>
</f:if>
</f:section>
</html>
2 changes: 1 addition & 1 deletion Resources/Private/Extensions/News/TypoScript/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugin.tx_news.settings.simpleList.cropMaxCharacters = 280

plugin.tx_news.settings.timeline.cropMaxCharacters = 500

plugin.tx_news.settings.list.media.dummyImage = typo3conf/ext/theme_t3kit/Resources/Public/Extensions/News/images/no_image.png
plugin.tx_news.settings.list.media.dummyImage = EXT:theme_t3kit/Resources/Public/Extensions/News/images/no_image.png

plugin.tx_news.settings.detail.shariff < tt_content.list.20.rxshariff_shariff.settings
plugin.tx_news.settings.detail.shariff {
Expand Down
7 changes: 7 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
<trans-unit id="news.more-link.linktext" xml:space="preserve">
<target>Öffne News - </target>
</trans-unit>
<!-- news pagination aria labels -->
<trans-unit id="paginate.list.ariaLabel" xml:space="preserve">
<target>Paginierung</target>
</trans-unit>
<trans-unit id="paginate.page.ariaLabel" xml:space="preserve">
<target>Seite</target>
</trans-unit>
</body>
</file>
</xliff>
7 changes: 7 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<trans-unit id="news.more-link.linktext" xml:space="preserve">
<source>Open News - </source>
</trans-unit>
<!--- news pagination aria labels -->
<trans-unit id="paginate.list.ariaLabel" xml:space="preserve">
<source>Pagination</source>
</trans-unit>
<trans-unit id="paginate.page.ariaLabel" xml:space="preserve">
<source>Page</source>
</trans-unit>


<!-- ContentElements labels -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
.news-simple-list__media-preview {
width: 100%;
height: 100%;
position: absolute;
}

.news-simple-list__text {
Expand Down