docbrown/app/views/articles/_reaction_button.html.erb
Julien Maury cb3d6f6d22
Remove HTML errors (PR n°2 - fixed) (#13350)
* delete alt attribute on span

* delete role checkbox on button - add type button

* delete wrong aria label

* sidebar-nav as class not ID

* delete duplicate attr class on single story

* delete duplicate attr class sidebar nav

* Revert "delete role checkbox on button - add type button"

This reverts commit 456fa676ff4457ffa724e9a07a3f123149dc5f39.

* delete role checkbox and modidy spec login modal js

* no need for name in cypress test showloginmodal anymore

* add attr data-test-id

* replace attr defer with DOMContentLoaded event

* delete useless class

* better a11y approach for button and cypress tests

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* better a11y approach for button and cypress tests

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* discussion_r612278777 : change initialize article reactions js

* revert replacing `const` with `let`

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* revert replacing `const` with `let`

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* apply `aria-hidden` on all reaction svg

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* keep original text `Saved` for bookmark button

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* fix missing aria-label on load - reaction button

* Revert "replace attr defer with DOMContentLoaded event"

This reverts commit db6a7eec051c443c18c17e23cf331132b222011f.

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-04-14 14:06:44 +02:00

16 lines
832 B
Text

<button
id="reaction-butt-<%= category %>"
aria-label="<%= aria_label %>"
class="crayons-reaction crayons-reaction--<%= category %>"
data-category="<%= category %>"
title="<%= description %>">
<span class="crayons-reaction__icon crayons-reaction__icon--inactive">
<%= inline_svg_tag(image_path, aria_hidden: true, class: "crayons-icon") %>
</span>
<% if user_signed_in? # We cannot trigger the action state unless the user is signed in, so no need to render. %>
<span class="crayons-reaction__icon crayons-reaction__icon--active">
<%= inline_svg_tag(image_active_path, aria_hidden: true, class: "crayons-icon") %>
</span>
<% end %>
<span class="crayons-reaction__count" id="reaction-number-<%= category %>"><span class="bg-base-40 opacity-25 p-2 inline-block radius-default"></span></span>
</button>