forked from fixin.me/fixin.me
Add stimulus-rails gem and wire up 7 controllers: - measurements_view_controller: view toggle (compact/wide) via localStorage - measurements_controller: grouped rows MutationObserver - charts_controller: Plotly chart rendering - form_controller: keyboard shortcuts (Escape/Enter) and submit validation - details_controller: quantity picker state, focusout close, MutationObserver - readout_unit_controller: default unit button enable/disable + PATCH submission - drag_controller: drag-and-drop for quantity reparenting and unit rebasing Remove all inline onclick/onkeydown/ondrag*/onsubmit handlers from templates. Remove all window.* global exports from application.js. Remove bare <script> block from measurements/_form.html.erb. Remove turbo:load listeners for behavior now in controller connect(). application.js now only contains: Turbo Stream custom action definitions and the showPage visibility listener. Document Stimulus conventions in CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
743 B
Plaintext
20 lines
743 B
Plaintext
<%= labeled_form_for resource, url: user_session_path,
|
|
html: {class: 'main-area', data: {controller: 'form', action: 'submit->form#validate'}} do |f| %>
|
|
|
|
<%= f.email_field :email, required: true, size: 30, autofocus: true,
|
|
autocomplete: 'email' %>
|
|
<%= f.password_field :password, required: true, size: 30,
|
|
autocomplete: 'current-password' %>
|
|
|
|
<% if devise_mapping.rememberable? %>
|
|
<%= f.check_box :remember_me %>
|
|
<% end %>
|
|
|
|
<%# /sign_in as HTML; /password as TURBO_STREAM %>
|
|
<%= f.submit t(:sign_in), data: {turbo: false} %>
|
|
|
|
<%= image_button_tag t(:recover_password), 'lock-reset', class: 'auxiliary',
|
|
formaction: user_password_path, formnovalidate: true,
|
|
data: {validate: f.field_id(:email)} %>
|
|
<% end %>
|