X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/17379ed7eb6e143667e53097f5ada570f051efd1..64e387b2f4f0fe6c4c7bf16232706c7cf194caf0:/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 82c2c15e40..6692196dab 100644 --- a/apps/workbench/app/views/users/profile.html.erb +++ b/apps/workbench/app/views/users/profile.html.erb @@ -1,9 +1,20 @@ +<%# Copyright (C) The Arvados Authors. All rights reserved. + +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 %>
@@ -16,7 +27,7 @@
<% if !missing_required_profile? && params[:offer_return_to] %>
- <% if current_user.prefs['getting_started_shown'] %> + <% if current_user.prefs[:getting_started_shown] %>

Thank you for filling in your profile. <%= link_to 'Back to work!', params[:offer_return_to], class: 'btn btn-sm btn-primary' %>

<% else %>

Thank you for filling in your profile. <%= link_to 'Get started', params[:offer_return_to], class: 'btn btn-sm btn-primary' %>

@@ -57,29 +68,29 @@
<% 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, _| %> <% end %>
<% else %>
- +
<% end %>
@@ -89,7 +100,7 @@ <%# If the user has other prefs, we need to preserve them %> <% current_user.prefs.each do |key, value| %> <% if key != :profile %> - + <% end %> <% end %>