% @title = t('.header') %>
<%= render 'account/shared/workflow/box' do |box| %>
<% box.title @title %>
<% box.body do %>
<% within_fields_namespace(:self) do %>
<%= form_for @user, url: account_onboarding_user_detail_path(@user), method: :put, html: {class: 'form'} do |f| %>
<%= render 'account/shared/forms/errors', form: f %>
<%= render 'account/shared/notices', form: f %>
<%= render 'shared/fields/text_field', form: f, method: :first_name, other_options: {required: true}, options: {autofocus: true} %>
<%= render 'shared/fields/text_field', form: f, method: :last_name, other_options: {required: true} %>
<% # only edit the team name if this user is an admin and they are the first user. %>
<% # yes, that's redundant. %>
<% if can?(:edit, f.object.current_team) && f.object.current_team.users.count == 1 %>
<%= f.fields_for :current_team do |tf| %>
<%= render 'shared/fields/text_field', form: tf, method: :name %>
<% end %>
<% end %>
<%= render 'shared/fields/super_select', form: f, method: :time_zone,
choices: time_zone_options_for_select(@user.time_zone, nil, ActiveSupport::TimeZone),
other_options: {search: true, required: true, use_browser_time_zone: true} %>
<%= f.submit t('.buttons.next'), class: first_button_primary %>
<% if other_teams.any? %>
<%= link_to t('global.buttons.back'), main_app.account_teams_path, class: first_button_primary %>
<% else %>
<%= link_to t('menus.main.labels.logout'), main_app.destroy_user_session_path(@user, onboard_logout: true), class: first_button_primary, method: 'delete' %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>