This way it'll be easier for people using screen readers to know which element the checkbox is related to. Note that we're using the `aria-label` attribute because it makes testing with Capybara easier than using the `aria-labelledby` attribute. The only exception are the comments, since comments don't have a title and there isn't a proper label for them. In this case, we're using the title of the associated commentable as the label; we might change it in the future since there might be many comments for the same commentable.
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
<%= render Moderation::Shared::IndexComponent.new(@debates) do %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("moderation.debates.index.headers.debate") %></th>
|
|
<th><%= t("moderation.debates.index.headers.moderate") %></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% @debates.each do |debate| %>
|
|
<tr id="debate_<%= debate.id %>">
|
|
<td>
|
|
<%= link_to debate.title, debate %>
|
|
<br>
|
|
<span class="date"><%= l debate.updated_at.to_date %></span>
|
|
<span class="bullet"> • </span>
|
|
<%= debate.flags_count %><span class="icon-flag flag-disable"></span>
|
|
<span class="bullet"> • </span>
|
|
<%= debate.author.username %>
|
|
<br>
|
|
<div class="moderation-description">
|
|
<%= wysiwyg(debate.description) %>
|
|
</div>
|
|
</td>
|
|
<td class="text-center">
|
|
<%= check_box_tag "debate_ids[]",
|
|
debate.id,
|
|
nil,
|
|
id: "#{dom_id(debate)}_check",
|
|
"aria-label": debate.title %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %>
|