Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.1 KB
Raw Blame
<%# Bot trap for public forms — see BotTrapProtected. Two fields:

      1. a honeypot input that is off-screen for sighted users and hidden from
         assistive technology, so only a script that fills every field it finds
         will touch it,
      2. a signed timestamp of this render, which is how the controller can tell
         a three-second submission from a human one.

    The wrapper carries aria-hidden AND the input carries tabindex="-1": the
    first keeps it out of the screen-reader tree, the second out of the tab
    order. Neither alone is enough. The label exists for the case where a reader
    ignores aria-hidden.

    Hidden via the .bot-trap class in views.css, NOT via an inline style block
    (CLAUDE.md) and NOT via display:none, which some scripts use as the signal
    to skip a field. %>
<div class="bot-trap" aria-hidden="true">
  <%= label_tag BotTrapProtected::HONEYPOT_FIELD, t('views.shared.bot_trap.honeypot_label') %>
  <%= text_field_tag BotTrapProtected::HONEYPOT_FIELD, nil,
        tabindex: -1, autocomplete: 'off' %>
</div>
<%= hidden_field_tag BotTrapProtected::TIMESTAMP_FIELD, bot_trap_timestamp %>