<%= t "devise.invitations.edit.header" %>

<%= t("devise.invitations.edit.subtitle").html_safe %>

<%= decidim_form_for resource, namespace: "invitation", as: resource_name, url: invitation_path(resource_name, invite_redirect: params[:invite_redirect]), html: { method: :put, class: "register-form new_user" } do |f| %>
<%= t("sign_up_as.legend", scope: "decidim.devise.registrations.new") %> <%= form_required_explanation %> <%= f.hidden_field :invitation_token %>
<%= f.text_field :nickname, help_text: t("devise.invitations.edit.nickname_help", organization: current_organization.name), required: "required", prefix: { value: "@", small: 1, large: 1 } %>
<% if f.object.class.require_password_on_accepting %>

<%= f.password_field :password, required: "required", minlength: ::Devise.password_length.min, maxlength: ::Devise.password_length.max %>

<%= f.password_field :password_confirmation, required: "required", minlength: ::Devise.password_length.min, maxlength: ::Devise.password_length.max %>

<% end %>
<%= t("tos_title", scope: "decidim.devise.registrations.new") %>

<%= strip_tags(translated_attribute(terms_and_conditions_page.content)) %>

<% link = link_to t("terms", scope: "decidim.devise.registrations.new"), page_path("terms-and-conditions"), target: "_blank" %> <% label = t("tos_agreement", scope: "decidim.devise.registrations.new", link: link) %> <%= f.check_box :tos_agreement, label: label, required: "required" %>
<%= t("newsletter_title", scope: "decidim.devise.registrations.new") %>
<%= label_tag :"#{resource_name}[newsletter_notifications]" do %> <%= check_box_tag :"#{resource_name}[newsletter_notifications]" %> <%= t("newsletter", scope: "decidim.devise.registrations.new") %> <% end %>
<%= f.submit t("devise.invitations.edit.submit_button"), class: "button expanded" %>
<% end %>