X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0eb72b526bf8bbb011551ecf019f604e17a534f1..5e9787f914dd1a2f762ae7a653fe8dda36f8f555:/apps/workbench/app/views/users/profile.html.erb diff --git a/apps/workbench/app/views/users/profile.html.erb b/apps/workbench/app/views/users/profile.html.erb index 26d1f57211..caa22bda11 100644 --- a/apps/workbench/app/views/users/profile.html.erb +++ b/apps/workbench/app/views/users/profile.html.erb @@ -3,11 +3,18 @@ SPDX-License-Identifier: AGPL-3.0 %> <% - profile_config = Rails.configuration.user_profile_form_fields + profile_config = [] + Rails.configuration.Workbench.UserProfileFormFields.each do |k, v| + r = v.dup + r["Key"] = k + profile_config << r + end + profile_config.sort_by! { |v| v["Position"] } + current_user_profile = current_user.prefs[:profile] show_save_button = false - profile_message = Rails.configuration.user_profile_form_message + profile_message = Rails.configuration.Workbench.UserProfileFormMessage %>
@@ -61,29 +68,30 @@ SPDX-License-Identifier: AGPL-3.0 %>
<% profile_config.kind_of?(Array) && profile_config.andand.each do |entry| %> - <% if entry['key'] %> + <% if entry[:Key] %> <% show_save_button = true - label = entry['required'] ? '* ' : '' - label += entry['form_field_title'] - value = current_user_profile[entry['key'].to_sym] if current_user_profile + label = entry[:Required] ? '* ' : '' + label += entry[:FormFieldTitle] + value = current_user_profile[entry[:Key].to_sym] if current_user_profile %>
- - <% if entry['type'] == 'select' %> + <% if entry[:Type] == 'select' %>
- + <% entry[:Options].each do |option, _| %> + <% option = option.to_s %> <% end %>
<% else %>
- +
<% end %>