Skip to content

Commit

Permalink
Disable edition of extra fields in profile if global setting is deact…
Browse files Browse the repository at this point in the history
…ivated
  • Loading branch information
entantoencuanto committed Apr 18, 2024
1 parent 634f98c commit b32285a
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions app/views/decidim/extra_user_fields/_profile_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<% if current_organization.activated_extra_field?(:date_of_birth) %>
<%= f.date_field :date_of_birth %>
<% end %>
<% if current_organization.extra_user_fields_enabled? %>
<% if current_organization.activated_extra_field?(:date_of_birth) %>
<%= f.date_field :date_of_birth %>
<% end %>

<% if current_organization.activated_extra_field?(:gender) %>
<%= f.collection_select :gender, f.object.gender_options_for_select, :first, :last %>
<% end %>
<% if current_organization.activated_extra_field?(:gender) %>
<%= f.collection_select :gender, f.object.gender_options_for_select, :first, :last %>
<% end %>

<% if current_organization.activated_extra_field?(:country) %>
<%= f.label :country do %>
<%= f.custom_country_select :country %>
<% if current_organization.activated_extra_field?(:country) %>
<%= f.label :country do %>
<%= f.custom_country_select :country %>
<% end %>
<% end %>
<% end %>

<% if current_organization.activated_extra_field?(:postal_code) %>
<%= f.text_field :postal_code %>
<% end %>
<% if current_organization.activated_extra_field?(:postal_code) %>
<%= f.text_field :postal_code %>
<% end %>

<% if current_organization.activated_extra_field?(:phone_number) %>
<%= f.telephone_field :phone_number, placeholder: f.object.phone_number_extra_user_field_placeholder, pattern: f.object.phone_number_extra_user_field_pattern %>
<% end %>
<% if current_organization.activated_extra_field?(:phone_number) %>
<%= f.telephone_field :phone_number, placeholder: f.object.phone_number_extra_user_field_placeholder, pattern: f.object.phone_number_extra_user_field_pattern %>
<% end %>

<% if current_organization.activated_extra_field?(:location) %>
<%= f.text_field :location %>
<% if current_organization.activated_extra_field?(:location) %>
<%= f.text_field :location %>
<% end %>
<% end %>

0 comments on commit b32285a

Please sign in to comment.