<% profile_config = Rails.configuration.user_profile_form_fields this_user = User.limit(1).where(uuid: current_user.uuid).first user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs current_user_profile = user_prefs[:profile] if user_prefs show_save_button = false %>

Profile

<% profile_message = 'You can manage your profile using this page. Any feilds in red are required and missing. Please fill in those fields before you can accesse Arvados Workbench.' profile_config.kind_of?(Array) && profile_config.andand.each do |entry| if entry['message'] profile_message = entry['message'] break end end %>

<%=profile_message%>


<%= form_tag "/users/#{current_user.uuid}", {method: 'patch', id: 'save_profile_form', name: 'save_profile_form', class: 'form-horizontal'} do %> <%= hidden_field_tag :return_to, request.url %>

<%=current_user.email%>

<%=current_user.first_name%>

<%=current_user.last_name%>

<%=this_user.andand.identity_url%>

<% profile_config.kind_of?(Array) && profile_config.andand.each do |entry| %> <% 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 %>
<% if entry['type'] == 'select' %>
<% else %>
<% end %>
<% end %> <% end %> <% if show_save_button %>
<% end %> <% end %>