Skip to content

Commit

Permalink
Use unique ids in people skills edit form to make turbo maintain scro…
Browse files Browse the repository at this point in the history
…ll position
  • Loading branch information
RandomTannenbaum committed Feb 19, 2025
1 parent 4950159 commit 26d692b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/people/people_skills/_edit_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
= ff.label :level
= ff.label(ti("people_skills.levels.#{ExpertiseTopicSkillValue.skill_levels.key(ff.object.level - 1)}"), {"data-people-skills-target": "label"})
- range_min = (ff.object.id.nil? || ff.object.level != 0) ? 1 : 0
= ff.range_field :level, min: range_min, max: 5, class: "form-range w-75",
= ff.range_field :level, min: range_min, max: 5, class: "form-range w-75", id: "level_#{ff.object.skill_id}",
"data-action": "change->people-skills#displayLevelLabel people-skills#rateSkill",
"data-people-skills-target": "switch"
%div.col-2
%div.d-flex.flex-column.align-items-center
= render partial: "edit_interest_stars", locals: { ff: ff }
%div.col-2
%div.d-flex.flex-row.form-check
= ff.check_box :certificate, { class: "form-check-input me-2", "data-action": "change->people-skills#rateSkill" }
= ff.check_box :certificate, { class: "form-check-input me-2", id: "certificate_#{ff.object.skill_id}", "data-action": "change->people-skills#rateSkill" }
= ff.label :certificate
%div.col-2
%div.d-flex.flex-row.form-check
= ff.check_box :core_competence, { class: "form-check-input me-2", "data-action": "change->people-skills#rateSkill" }
= ff.check_box :core_competence, { class: "form-check-input me-2", id: "core_competence_#{ff.object.skill_id}", "data-action": "change->people-skills#rateSkill" }
= ff.label :core_competence
= ff.hidden_field :skill_id
%div.col-2
Expand Down

0 comments on commit 26d692b

Please sign in to comment.