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.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
<%= render Moderation::Shared::IndexComponent.new(@proposals) do %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= t("moderation.proposals.index.headers.proposal") %></th>
|
|
<th><%= t("moderation.proposals.index.headers.moderate") %></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
<% @proposals.each do |proposal| %>
|
|
<tr id="proposal_<%= proposal.id %>">
|
|
<td>
|
|
<%= link_to proposal.title, proposal %>
|
|
<br>
|
|
<span class="date"><%= l proposal.updated_at.to_date %></span>
|
|
<span class="bullet"> • </span>
|
|
<%= proposal.flags_count %><span class="icon-flag flag-disable"></span>
|
|
<span class="bullet"> • </span>
|
|
<%= proposal.author.username %>
|
|
<br>
|
|
<div class="moderation-description">
|
|
<%= wysiwyg(proposal.description) %>
|
|
</div>
|
|
</td>
|
|
<td class="text-center">
|
|
<%= check_box_tag "proposal_ids[]",
|
|
proposal.id,
|
|
nil,
|
|
id: "#{dom_id(proposal)}_check",
|
|
"aria-label": proposal.title %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% end %>
|