Skip to content

Commit

Permalink
fix displaying of values in dropdowns, to represent actual state of o…
Browse files Browse the repository at this point in the history
…bject and add fields for percentage and level
  • Loading branch information
RandomTannenbaum committed Feb 19, 2024
1 parent 00c1dc6 commit 362b316
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions app/views/people/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,19 @@
%tr
%td= form.text_field :title
%th.fw-light Funktionen
- @entry.roles.each do
- @entry.roles.each do |role|
%tr
%td
%div.border.border-dark-subtle.rounded.p-1
= form.collection_select :role, Role.order(:name), :id, :name

%th.fw-light Organisationseinheit
= form.collection_select :role_id, Role.order(:name), :id, :name, { selected: role.id }
= form.collection_select :person_role_level_id, PersonRoleLevel.order(:level), :id, :level
= form.number_field :percent, step: 1
%th.fw-light Organisationseinheit :
%tr
%td= form.collection_select :department, Department.order(:name), :id, :name
%td= form.collection_select :department_id, Department.order(:name), :id, :name
%th.fw-light Firma
%tr
%td= form.collection_select :company, Company.order(:name), :id, :name
%td= form.collection_select :company_id, Company.order(:name), :id, :name
%th.fw-light Wohnort (Stadt)
%tr
%td= form.text_field :location
Expand All @@ -93,13 +94,14 @@
%td= form.date_field :birthdate
%th.fw-light Doppelbürger
%tr
%td= form.check_box :nationality2?
%td= check_box :has_nationality2?, { checked: @entry.nationality2? }
%th.fw-light Erste Nationalität
%tr
%td= form.collection_select :nationality, ISO3166::Country.all, :alpha2, :name
%th.fw-light Zweite Nationalität
%tr
%td= form.collection_select :nationality, ISO3166::Country.all, :alpha2, :name
%td= form.collection_select :nationality, ISO3166::Country.all.sort, :alpha2, :name
- if :has_nationality2?
%th.fw-light Zweite Nationalität
%tr
%td= form.collection_select :nationality2, ISO3166::Country.all.sort, :alpha2, :name
%th.fw-light Zivilstand
%tr
%td= form.collection_select :marital_status, Person.marital_statuses, :second, :first
%td= form.collection_select :marital_status, Person.marital_statuses, :second, :first, { selected: Person.marital_statuses[@entry.marital_status] }

0 comments on commit 362b316

Please sign in to comment.