mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 23:15:34 +08:00
80 lines
2.2 KiB
Text
80 lines
2.2 KiB
Text
<% provide(:head_title, t("users.invitations.edit.head_title")) %>
|
|
|
|
<div class="center-block center-block-narrow">
|
|
|
|
<h2><%= t 'devise.invitations.edit.header' %></h2>
|
|
|
|
<%= form_for (resource or :user), as: resource_name, url: invitation_path(resource_name), html: { method: :put } do |f| %>
|
|
|
|
<%= f.hidden_field :invitation_token %>
|
|
|
|
<div class="form-group">
|
|
<%= f.label :full_name %>
|
|
<%= f.text_field :full_name,
|
|
value: (params[:user] ? params[:user][:full_name] : ''),
|
|
autofocus: true,
|
|
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">
|
|
<%= f.label :password_confirmation %>
|
|
<%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control" %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= label :organization, :name, t('users.registrations.new.team_name_label') %>
|
|
<% if @org %>
|
|
<%= text_field :organization, :name, class: "form-control", value: @org.name %>
|
|
<% else %>
|
|
<%= text_field :organization,
|
|
:name,
|
|
class: 'form-control',
|
|
value: (params[:organization] ? params[:organization][:name] : '') %>
|
|
<% end %>
|
|
<span><small><%= t 'users.registrations.new.team_name_help' %></small></span>
|
|
</div>
|
|
|
|
<%= recaptcha_input_tag %>
|
|
|
|
<div class="form-group" data-hook="confirm-invitation-form-submit">
|
|
<%= f.submit "Sign Up", class: "btn btn-primary" %>
|
|
</div>
|
|
|
|
<% end %>
|
|
</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 @org and not @org.errors.empty? %>
|
|
<script>
|
|
(function () {
|
|
var formErrors = {};
|
|
|
|
<% @org.errors.each do |err, m| %>
|
|
formErrors["<%= err %>"] =["<%= m %>"];
|
|
<% end %>
|
|
|
|
$("form").renderFormErrors("organization", formErrors, false);
|
|
}());
|
|
</script>
|
|
<% end %>
|