2016-02-12 23:52:43 +08:00
|
|
|
<% provide(:head_title, t("users.invitations.edit.head_title")) %>
|
|
|
|
|
|
|
|
<div class="center-block center-block-narrow">
|
|
|
|
|
|
|
|
<h2><%= t 'devise.invitations.edit.header' %></h2>
|
|
|
|
|
2023-05-05 16:40:24 +08:00
|
|
|
<%= form_for (resource or :user), as: resource_name, url: invitation_path(resource_name), html: { method: :put, id: 'invitation-form' } do |f| %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
|
|
|
<%= f.hidden_field :invitation_token %>
|
|
|
|
|
2022-06-09 17:40:22 +08:00
|
|
|
<p class="sci-input-container">
|
2016-11-25 18:15:10 +08:00
|
|
|
<%= f.label :full_name %>
|
2016-12-02 23:07:00 +08:00
|
|
|
<%= f.text_field :full_name,
|
|
|
|
value: (params[:user] ? params[:user][:full_name] : ''),
|
|
|
|
autofocus: true,
|
2022-06-09 17:40:22 +08:00
|
|
|
class: 'sci-input-field' %>
|
|
|
|
</p>
|
2016-11-25 18:15:10 +08:00
|
|
|
|
2022-06-09 17:40:22 +08:00
|
|
|
<p class="sci-input-container">
|
2016-02-12 23:52:43 +08:00
|
|
|
<%= f.label :password %>
|
|
|
|
<% if @minimum_password_length %>
|
|
|
|
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
|
|
|
<% end %>
|
2022-06-09 17:40:22 +08:00
|
|
|
<%= f.password_field :password, autocomplete: "off", class: "sci-input-field" %>
|
|
|
|
</p>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2022-06-09 17:40:22 +08:00
|
|
|
<p class="sci-input-container">
|
2016-02-12 23:52:43 +08:00
|
|
|
<%= f.label :password_confirmation %>
|
2022-06-09 17:40:22 +08:00
|
|
|
<%= f.password_field :password_confirmation, autocomplete: "off", class: "sci-input-field" %>
|
|
|
|
</p>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2017-10-25 21:29:04 +08:00
|
|
|
<% if Rails.configuration.x.new_team_on_signup %>
|
2022-06-09 17:40:22 +08:00
|
|
|
<p class="sci-input-container"
|
2017-02-03 23:53:42 +08:00
|
|
|
data-hook="confirm-invitation-team-name">
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
|
|
|
|
<% if @team %>
|
2022-06-09 17:40:22 +08:00
|
|
|
<%= text_field :team, :name, class: 'sci-input-field', value: @team.name %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= text_field :team,
|
2016-12-02 23:07:00 +08:00
|
|
|
:name,
|
|
|
|
class: 'form-control',
|
2017-01-25 19:01:23 +08:00
|
|
|
value: (params[:team] ? params[:team][:name] : '') %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2022-06-09 17:40:22 +08:00
|
|
|
</p>
|
2017-10-25 21:29:04 +08:00
|
|
|
<% end %>
|
2016-11-24 21:19:44 +08:00
|
|
|
<%= recaptcha_input_tag %>
|
2016-11-23 21:28:32 +08:00
|
|
|
|
2016-11-25 18:52:33 +08:00
|
|
|
<div class="form-group" data-hook="confirm-invitation-form-submit">
|
2023-05-05 16:40:24 +08:00
|
|
|
<%= f.submit "Sign Up", class: "btn btn-primary invitation-submit" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</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-05-03 17:31:17 +08:00
|
|
|
<%= form_errors = {} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-08-13 17:34:21 +08:00
|
|
|
<% resource.errors.as_json.each do |err, messages| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err] = [] %>
|
2020-08-13 17:34:21 +08:00
|
|
|
<% messages.each do |message| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err].push(message) %>
|
2020-08-13 17:34:21 +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>
|
|
|
|
<%= javascript_include_tag 'users/invitations/resource_errors', nonce: true %>
|
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
|
|
|
|
|
|
|
<%= form_errors = {} %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
2020-08-13 17:34:21 +08:00
|
|
|
<% @team.errors.as_json.each do |err, messages| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err] = [] %>
|
2020-08-13 17:34:21 +08:00
|
|
|
<% messages.each do |message| %>
|
2023-05-03 17:31:17 +08:00
|
|
|
<% form_errors[err].push(message) %>
|
2020-08-13 17:34:21 +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>
|
|
|
|
<%= javascript_include_tag 'users/invitations/team_errors', nonce: true %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|