Files
nairobi/app/views/users/registrations/new.html.erb
Javi Martín ed2b217a08 Remove duplication in oauth actions
We were writing the same code twice, with the only difference being the
text "Sign up" in the sign_up action, and "Sign in" in the sign_in
action.

Note we're renaming the `omniauth.info_*` I18n keys so we don't need to
add new exceptions to the `ignore_unused` list, and so it's consistent
with all the other keys under the `omniauth` key.
2020-07-27 14:46:20 +02:00

55 lines
2.4 KiB
Plaintext

<% provide :title do %><%= t("devise_views.users.registrations.new.title") %><% end %>
<h2><%= t("devise_views.users.registrations.new.title") %></h2>
<%= render "devise/omniauth_form", action: "sign_up" %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "shared/errors", resource: resource %>
<p>
<%= sanitize(t("devise_views.users.registrations.new.organization_signup",
signup_link: link_to(t("devise_views.users.registrations.new.organization_signup_link"), new_organization_registration_path))) %>
</p>
<div class="row">
<div class="small-12 column">
<%= f.hidden_field :use_redeemable_code %>
<%= f.hidden_field :locale, value: I18n.locale %>
<%= f.text_field :username, autofocus: true, maxlength: User.username_max_length,
placeholder: t("devise_views.users.registrations.new.username_label"),
hint: t("devise_views.users.registrations.new.username_note") %>
<%= f.invisible_captcha :address %>
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %>
<%= f.password_field :password, autocomplete: "off",
placeholder: t("devise_views.users.registrations.new.password_label") %>
<%= f.password_field :password_confirmation, autocomplete: "off",
label: t("devise_views.users.registrations.new.password_confirmation_label"),
placeholder: t("devise_views.users.registrations.new.password_confirmation_label") %>
<% if resource.use_redeemable_code %>
<%= f.text_field :redeemable_code, placeholder: t("devise_views.users.registrations.new.redeemable_code") %>
<% end %>
<%= f.check_box :terms_of_service,
title: t("devise_views.users.registrations.new.terms_title"),
label: t("devise_views.users.registrations.new.terms",
terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions",
title: t("shared.target_blank"),
target: "_blank")
) %>
<div class="small-12 medium-6 small-centered">
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
</div>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>