<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <% if resource.errors.any? %>
Please fix the following errors:
    <%= devise_error_messages! %>
<% end %>
Sign up for Notebook.ai
<%= image_tag 'logos/both-small.webp', class: 'hide-on-small-only', style: 'width: 100%' %> <%= image_tag 'logos/book-small.webp', class: 'hide-on-med-and-up', style: 'width: 100%' %>
<%= f.label 'Your name' %>
<%= f.text_field :name, autofocus: true %>
<%= f.label :email %> (This is the email you will log in with)
<%= f.email_field :email %>
<%= f.label :password %> <% if @minimum_password_length %> (<%= @minimum_password_length %> characters minimum) <% end %>
<%= f.password_field :password, autocomplete: "off" %>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autocomplete: "off" %>
<% if params.key?('referral') || session.key?('referral') referral_code = params['referral'] || session['referral'] referrer = ReferralCode.where(code: referral_code).first if referrer.present? %>
<%= f.label :referral_code %>
<%= f.text_field :referral_code, value: referral_code, readonly: true %>
<%= f.label 'The following user will receive credit for referring you' %>
<%= f.text_field :referral_user, value: referrer.user.name.split('@').first, disabled: "disabled" %>
<% end end %>
<%= f.label :email_updates do %> <%= f.check_box :email_updates %> We're always working to improve Notebook.ai. Please leave this box checked if you'd like to receive occasional updates about what's new. <% end %>
<%= f.submit "Sign up", class: 'btn btn-large blue' %>


<%= render "devise/shared/links" %>

<% end %>