2017-01-25 19:01:23 +08:00
|
|
|
<% provide(:head_title, t('users.registrations.new.head_title')) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
|
|
|
<div class="center-block center-block-narrow">
|
|
|
|
<h2>Sign up</h2>
|
2017-07-03 17:28:35 +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
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :full_name %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= f.text_field :full_name, autofocus: true, class: 'form-control' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :email %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= f.email_field :email, class: 'form-control' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :password %>
|
|
|
|
<% if @minimum_password_length %>
|
|
|
|
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
|
|
|
<% end %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= f.password_field :password, autocomplete: 'off', class: 'form-control' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<%= f.label :password_confirmation %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
|
|
|
|
<% if @team %>
|
|
|
|
<%= text_field :team, :name, class: 'form-control', value: @team.name %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= text_field :team, :name, class: 'form-control' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-09-21 21:54:12 +08:00
|
|
|
<span><small><%= t 'users.registrations.new.team_name_help' %></small></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
2016-11-23 00:57:42 +08:00
|
|
|
<%= recaptcha_input_tag %>
|
2016-11-22 21:57:41 +08:00
|
|
|
|
2016-11-25 18:50:02 +08:00
|
|
|
<div class="form-group" data-hook="sign-up-form-submit">
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= f.submit 'Sign up', class: 'btn btn-primary' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2017-06-30 16:06:54 +08:00
|
|
|
</div>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= render 'users/shared/links' %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if resource and not resource.errors.empty? %>
|
|
|
|
<script>
|
|
|
|
(function () {
|
|
|
|
var formErrors = {};
|
|
|
|
|
|
|
|
<% resource.errors.each do |err, m| %>
|
|
|
|
formErrors["<%= err %>"] =["<%= m %>"];
|
|
|
|
<% end %>
|
|
|
|
|
2016-08-11 22:05:23 +08:00
|
|
|
$("form").renderFormErrors("user", formErrors, false);
|
2016-02-12 23:52:43 +08:00
|
|
|
}());
|
|
|
|
</script>
|
|
|
|
<% end %>
|
|
|
|
|
2017-01-25 19:01:23 +08:00
|
|
|
<% if @team and not @team.errors.empty? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<script>
|
|
|
|
(function () {
|
|
|
|
var formErrors = {};
|
|
|
|
|
2017-01-25 19:01:23 +08:00
|
|
|
<% @team.errors.each do |err, m| %>
|
2016-02-12 23:52:43 +08:00
|
|
|
formErrors["<%= err %>"] =["<%= m %>"];
|
|
|
|
<% end %>
|
|
|
|
|
2017-01-25 19:01:23 +08:00
|
|
|
$("form").renderFormErrors('team', formErrors, false);
|
2016-02-12 23:52:43 +08:00
|
|
|
}());
|
|
|
|
</script>
|
|
|
|
<% end %>
|