2017-01-25 19:01:23 +08:00
|
|
|
<% provide(:head_title, t('users.registrations.new.head_title')) %>
|
2020-03-27 16:43:49 +08:00
|
|
|
<% content_for(:body_class, 'sign-up-layout') %>
|
|
|
|
<div class="sign-up-container">
|
|
|
|
<div class="sign-up-form-wrapper">
|
|
|
|
<div class="center-block center-block-narrow">
|
|
|
|
<h1 class="sign-up-title"><%= t 'users.registrations.new.head_title' %></h1>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<%- if Rails.configuration.x.enable_user_registration && Rails.configuration.x.linkedin_signin_enabled && @oauth_authorize != true %>
|
|
|
|
<div class="linkedin-container">
|
|
|
|
<%= render partial: "users/shared/linkedin_sign_in_links", locals: { resource_name: resource_name } %>
|
|
|
|
<span><%= t("devise.sessions.new.or") %></span>
|
|
|
|
</div>
|
|
|
|
<% end -%>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<div data-hook="sign-up-form-hook">
|
|
|
|
<%= form_for(:user, as: resource_name, url: registration_path(resource_name), html: { id: "sign-up-form" } ) do |f| %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<div class="form-group sci-input-container">
|
2020-03-27 17:34:06 +08:00
|
|
|
<%= f.label :full_name, t('users.registrations.new.full_name_label') %>
|
2020-03-27 16:43:49 +08:00
|
|
|
<%= f.text_field :full_name, autofocus: true, class: 'form-control sci-input-field' %>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<div class="form-group sci-input-container">
|
2020-03-27 17:34:06 +08:00
|
|
|
<%= f.label :email, t('users.registrations.new.email_label') %>
|
2020-03-27 16:43:49 +08:00
|
|
|
<%= f.email_field :email, class: 'form-control sci-input-field' %>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<div class="form-group sci-input-container">
|
2020-03-27 17:34:06 +08:00
|
|
|
<%= f.label :password, t('users.registrations.new.password_label') %>
|
2020-03-27 16:43:49 +08:00
|
|
|
<% if @minimum_password_length %>
|
2020-03-27 17:34:06 +08:00
|
|
|
<em class="minimum-password-length"><%= t('users.registrations.new.minimum_password_length', password_length: @minimum_password_length) %></em>
|
2020-03-27 16:43:49 +08:00
|
|
|
<% end %>
|
|
|
|
<%= f.password_field :password, autocomplete: 'off', class: 'form-control sci-input-field' %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group sci-input-container" id="password_confirmation_form">
|
2020-03-27 17:34:06 +08:00
|
|
|
<%= f.label :password_confirmation, t('users.registrations.new.password_confirmation_label') %>
|
2020-03-27 16:43:49 +08:00
|
|
|
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control sci-input-field' %>
|
|
|
|
</div>
|
|
|
|
<% if Rails.configuration.x.new_team_on_signup %>
|
|
|
|
<div class="form-group sci-input-container" id="team_name_form">
|
|
|
|
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
|
|
|
|
<% if @team %>
|
|
|
|
<%= text_field :team, :name, class: 'form-control sci-input-field', value: @team.name,
|
|
|
|
placeholder: t('users.registrations.new.team_name_placeholder') %>
|
|
|
|
<% else %>
|
|
|
|
<%= text_field :team, :name, class: 'form-control sci-input-field',
|
|
|
|
placeholder: t('users.registrations.new.team_name_placeholder') %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%= recaptcha_input_tag %>
|
2016-11-22 21:57:41 +08:00
|
|
|
|
2020-03-27 16:43:49 +08:00
|
|
|
<div class="form-group" data-hook="sign-up-form-submit">
|
2020-07-06 20:52:42 +08:00
|
|
|
<%= f.button 'Sign up', class: 'btn btn-primary sign-up-button' %>
|
2020-03-27 16:43:49 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<%= render partial: 'users/shared/links', locals: {linkedin_skip: true} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2017-06-30 16:06:54 +08:00
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
2023-05-05 16:40:24 +08:00
|
|
|
<%= render partial: 'users/sessions/login_disclaimer'%>
|
|
|
|
|
2021-07-23 17:56:28 +08:00
|
|
|
<% if resource && resource.errors.present? %>
|
2023-06-02 21:35:29 +08:00
|
|
|
<% form_errors = {} %>
|
2023-05-03 17:31:17 +08:00
|
|
|
|
2020-08-11 21:39:35 +08:00
|
|
|
<% resource.errors.as_json.each do |err, messages| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err] = [] %>
|
2020-08-11 21:39:35 +08:00
|
|
|
<% messages.each do |message| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err].push(message) %>
|
2020-08-11 21:39:35 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<div class="hidden" id="resource-error-data" data-form-errors="<%= form_errors.to_json %>"></div>
|
2023-06-16 16:19:54 +08:00
|
|
|
<%= javascript_include_tag 'users/registrations/resource_errors' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
|
|
|
|
2021-07-23 17:56:28 +08:00
|
|
|
<% if @team && @team.errors.present? %>
|
2023-05-03 17:31:17 +08:00
|
|
|
|
2023-06-02 21:35:29 +08:00
|
|
|
<% form_errors = {} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-08-11 21:39:35 +08:00
|
|
|
<% @team.errors.as_json.each do |err, messages| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err] = [] %>
|
2020-08-11 21:39:35 +08:00
|
|
|
<% messages.each do |message| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err].push(message) %>
|
2020-08-11 21:39:35 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<div class="hidden" id="team-error-data" data-form-errors="<%= form_errors.to_json %>"></div>
|
2023-06-16 16:19:54 +08:00
|
|
|
<%= javascript_include_tag 'users/registrations/team_errors' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|