Using `<a>` tags with no `href` means these elements cannot be activated by keyboard users, so we're replacing them with buttons. In the future we probably want to add more consistency so all toggle buttons use the same code. We might also add styles depending on the `aria-expanded` property.
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
<span class="flag-content">
|
|
<% if show_flag_action?(flaggable) %>
|
|
<% if local_assigns[:divider] %>
|
|
<span class="divider"> | </span>
|
|
<% end %>
|
|
|
|
<button type="button" data-toggle="flag-drop-<%= dom_id(flaggable) %>" title="<%= t("shared.flag") %>">
|
|
<span class="icon-flag flag-disable"></span>
|
|
</button>
|
|
<span class="dropdown-pane" id="flag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
|
<%= link_to t("shared.flag"), polymorphic_path(flaggable, action: :flag), method: :put, remote: true %>
|
|
</span>
|
|
<% end %>
|
|
|
|
<% if show_unflag_action?(flaggable) %>
|
|
<% if local_assigns[:divider] %>
|
|
<span class="divider"> | </span>
|
|
<% end %>
|
|
|
|
<button type="button" data-toggle="unflag-drop-<%= dom_id(flaggable) %>" title="<%= t("shared.unflag") %>">
|
|
<span class="icon-flag flag-active"></span>
|
|
</button>
|
|
<span class="dropdown-pane" id="unflag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
|
|
<%= link_to t("shared.unflag"), polymorphic_path(flaggable, action: :unflag), method: :put, remote: true %>
|
|
</span>
|
|
<% end %>
|
|
</span>
|