Add a descriptive title to the series links (#1329)

It's easy to navigate each part of a series when there only a few of them. It's hard to jump from a part to another if there are many. This change makes it also a little friendlier to accessibility tools.
This commit is contained in:
rhymes 2018-12-15 18:44:29 +01:00 committed by Ben Halpern
parent cf060d09e9
commit 73ddff4549

View file

@ -7,11 +7,12 @@
<p>Part of a series</p>
<% end %>
<div class="article-collection">
<% @collection.articles.where(published: true).order("published_at ASC").each_with_index do |article,i| %>
<% @collection.articles.where(published: true).order("published_at ASC").each_with_index do |article, i| %>
<a
href="<%= article.path if article.published %>"
class="<%= collection_link_class(@article,article) %>"
class="<%= collection_link_class(@article, article) %>"
data-preload-image="<%=cloud_cover_url(article.main_image) %>"
title="Part <%= i + 1 %>: <%= article.title %>"
>
</a>
<% end %>