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

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

<%= decidim_form_for resource, 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") %> <%= f.hidden_field :invitation_token %>
<%= f.text_field :nickname, help_text: t("devise.invitations.edit.nickname_help", organization: current_organization.name), required: "required" %>
<% if f.object.class.require_password_on_accepting %>
<%= f.password_field :password, required: "required" %>

<%= f.password_field :password_confirmation, required: "required" %>

<% 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") %>
<%= check_box_tag :"#{resource_name}[newsletter_notifications]", label: t("newsletter", scope: "decidim.devise.registrations.new") %>
<%= f.submit t("devise.invitations.edit.submit_button"), class: "button expanded" %>
<% end %>