diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 3c44b5cd..e8399130 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -14,6 +14,10 @@ class MainController < ApplicationController def index redirect_to(:dashboard) if user_signed_in? + + @resource ||= User.new + @resource_name = :user + @devise_mapping ||= Devise.mappings[:user] end def about_notebook diff --git a/app/helpers/devise_helper.rb b/app/helpers/devise_helper.rb index 3efb4c80..ca61f0d2 100644 --- a/app/helpers/devise_helper.rb +++ b/app/helpers/devise_helper.rb @@ -2,4 +2,16 @@ module DeviseHelper def devise_error_messages! resource.errors.full_messages.map { |msg| content_tag(:li, msg + '.') }.join.html_safe end + + def resource_name + :user + end + + def resource + @resource ||= User.new + end + + def devise_mapping + @devise_mapping ||= Devise.mappings[:user] + end end \ No newline at end of file diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb index f1e1668a..5ccc087f 100644 --- a/app/views/main/index.html.erb +++ b/app/views/main/index.html.erb @@ -135,14 +135,13 @@
- <% 9.times do %>
face
-

+

<%= t('marketing.landing_page.benefits.characters.title') %>

@@ -151,12 +150,171 @@

- <% end %> - - +
+
+
+ list +
+
+

+ <%= t('marketing.landing_page.benefits.organization.title') %> +

+

+ <%= t('marketing.landing_page.benefits.organization.text') %> +

+
+
+
+
+
+
+ cloud +
+
+

+ <%= t('marketing.landing_page.benefits.backups.title') %> +

+

+ <%= t('marketing.landing_page.benefits.backups.text') %> +

+
+
+
+
+
+
+ <%= Document.icon %> +
+
+

+ Unlimited document storage +

+

+ Write quickly with reference sheets at the ready. You can view details about + your world without leaving the editor! +

+
+
+
+
+
+
+ group +
+
+

+ <%= t('marketing.landing_page.benefits.sharing.title') %> +

+

+ <%= t('marketing.landing_page.benefits.sharing.text') %> +

+
+
+
+
+
+
+ security +
+
+

+ <%= t('marketing.landing_page.benefits.ads.title') %> +

+

+ <%= t('marketing.landing_page.benefits.ads.text') %> +

+
+
+
+
+
+
+
+

+ It takes a just few seconds to sign up and start materializing the wonderful worlds in your head. +

+

+ Once you've signed up, you can immediately start creating universes and filling them with characters, + locations, and items. The worlds you create are private, owned by you, and always available on any + device, any time you need them. +

+

+ trusted by +

+
+
+

Sign up for Notebook.ai

+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + +
+ <%= f.label 'Your name', class: 'leading-7 text-sm text-gray-600' %> + <%= f.text_field :name, class: 'w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out' %> +
+ +
+ <%= f.label :email, class: 'leading-7 text-sm text-gray-600' %> + (This is the email you will log in with) + <%= f.email_field :email, class: 'w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out' %> +
+ +
+ <%= f.label :password, class: 'leading-7 text-sm text-gray-600' %> + <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum) + <% end %>
+ <%= f.password_field :password, autocomplete: "off", class: 'w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out' %> +
+ +
+ <%= f.label :password_confirmation, class: 'leading-7 text-sm text-gray-600' %>
+ <%= f.password_field :password_confirmation, autocomplete: "off", class: 'w-full bg-white rounded border border-gray-300 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 text-base outline-none text-gray-700 py-1 px-3 leading-8 transition-colors duration-200 ease-in-out' %> +
+ +
+ <%= 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 %> +
+ + <% + 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.submit "Sign up", class: 'w-full text-white bg-blue-500 border-0 py-2 px-8 focus:outline-none hover:bg-blue-600 rounded text-lg cursor-pointer' %> + <% end %> +
+
+
+ + +
@@ -165,15 +323,6 @@
-
-
-
face
-

<%= t('marketing.landing_page.benefits.characters.title') %>

-

- <%= t('marketing.landing_page.benefits.characters.text') %> -

-
-
@@ -185,47 +334,6 @@
-
-
-
list
-

<%= t('marketing.landing_page.benefits.organization.title') %>

-

- <%= t('marketing.landing_page.benefits.organization.text') %> -

-
-
-
-
-
-
-
group
-

<%= t('marketing.landing_page.benefits.sharing.title') %>

-

- <%= t('marketing.landing_page.benefits.sharing.text') %> -

-
-
- -
-
-
cloud
-

<%= t('marketing.landing_page.benefits.backups.title') %>

-

- <%= t('marketing.landing_page.benefits.backups.text') %> -

-
-
- -
-
-
security
-

<%= t('marketing.landing_page.benefits.ads.title') %>

-

- <%= t('marketing.landing_page.benefits.ads.text') %> -

-
-
-