scinote-web/app/views/users/registrations/new.html.erb

79 lines
2.4 KiB
Text

<% provide(:head_title, t('users.registrations.new.head_title')) %>
<div class="center-block center-block-narrow">
<h2>Sign up</h2>
<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| %>
<div class="form-group">
<%= f.label :full_name %>
<%= f.text_field :full_name, autofocus: true, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %>
<%= f.password_field :password, autocomplete: 'off', class: 'form-control' %>
</div>
<div class="form-group" id="password_confirmation_form">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
</div>
<% if Rails.configuration.x.new_team_on_signup %>
<div class="form-group" id="team_name_form">
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
<% if @team %>
<%= text_field :team, :name, class: 'form-control', value: @team.name,
placeholder: t('users.registrations.new.team_name_placeholder') %>
<% else %>
<%= text_field :team, :name, class: 'form-control',
placeholder: t('users.registrations.new.team_name_placeholder') %>
<% end %>
<span><small><%= t 'users.registrations.new.team_name_help' %></small></span>
</div>
<% end %>
<%= recaptcha_input_tag %>
<div class="form-group" data-hook="sign-up-form-submit">
<%= f.submit 'Sign up', class: 'btn btn-primary' %>
</div>
<% end %>
</div>
<%= render 'users/shared/links' %>
</div>
<% if resource and not resource.errors.empty? %>
<script>
(function () {
var formErrors = {};
<% resource.errors.each do |err, m| %>
formErrors["<%= err %>"] =["<%= m %>"];
<% end %>
$("form").renderFormErrors("user", formErrors, false);
}());
</script>
<% end %>
<% if @team and not @team.errors.empty? %>
<script>
(function () {
var formErrors = {};
<% @team.errors.each do |err, m| %>
formErrors["<%= err %>"] =["<%= m %>"];
<% end %>
$("form").renderFormErrors('team', formErrors, false);
}());
</script>
<% end %>