From 8e4e861795e94ee178ffe26104344817fdf4e226 Mon Sep 17 00:00:00 2001 From: Canan Ercan Date: Tue, 26 May 2020 01:13:31 +0300 Subject: [PATCH] Add log in & sign up pages and its logic (#1) --- app/views/devise/registrations/new.html.erb | 66 +++++++++++++-------- app/views/devise/sessions/new.html.erb | 61 ++++++++++++------- app/views/welcome/index.html.erb | 58 ------------------ 3 files changed, 78 insertions(+), 107 deletions(-) diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index d655b66..d859254 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,29 +1,43 @@ -

Sign up

- -<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> +
<%= render "devise/shared/error_messages", resource: resource %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %> -
- -
- <%= f.label :password %> - <% if @minimum_password_length %> - (<%= @minimum_password_length %> characters minimum) - <% end %>
- <%= f.password_field :password, autocomplete: "new-password" %> -
- -
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "new-password" %> -
- -
- <%= f.submit "Sign up" %> +
+
+
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: "ui form"}) do |f| %> +
+ <%= f.label :email %> +
+ <%= f.email_field :email, placeholder: "Email", autofocus: true, autocomplete: "email" %> + +
+
+
+ <%= f.label :password %> +
+ <%= f.password_field :password, autocomplete: "new-password", placeholder: "Password" %> + +
+
+
+ <%= f.label :password_confirmation %> +
+ <%= f.password_field :password_confirmation, autocomplete: "new-password", placeholder: "Password" %> + +
+
+ <%= f.button "Sign up", class: "ui blue submit button" %> + <% end %> +
+
+
+ <%= link_to "Log in", session_path(resource_name), class: "ui big button" %> +
+
+
+
+ Or +
-<% end %> +
-<%= render "devise/shared/links" %> + diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 5ede964..09f4f34 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,26 +1,41 @@ -

Log in

- -<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %> -
- -
- <%= f.label :password %>
- <%= f.password_field :password, autocomplete: "current-password" %> -
- - <% if devise_mapping.rememberable? %> -
- <%= f.check_box :remember_me %> - <%= f.label :remember_me %> +
+
+
+
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "ui form" }) do |f| %> +
+ <%= f.label :email %> +
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "Email" %> + +
+
+
+ <%= f.label :password %> +
+ <%= f.password_field :password, autocomplete: "current-password", placeholder: "Password" %> + +
+
+ <% if devise_mapping.rememberable? %> +
+ <%= f.check_box :remember_me %> + <%= f.label :remember_me %> +
+ <% end %> + <%= f.button "Log in", class: "ui blue submit button" %> + <% end %> +
+
+
+ <%= link_to "Sign up", new_user_registration_path, class: "ui big button" %> +
+
+
+
+ Or
- <% end %> - -
- <%= f.submit "Log in" %>
-<% end %> +
-<%= render "devise/shared/links" %> + \ No newline at end of file diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index adfe0ce..b88508c 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,59 +1 @@ -

Welcome to Pretro!

-
-
-
-
- <%= form_with scope: :session, class: "ui form", url: user_session_path, html: { method: :post } do |f| %> -
- <%= f.label :email %> -
- <%= f.text_field :email, placeholder: "Email" %> - -
-
-
- <%= f.label :password %> -
- <%= f.text_field :password, placeholder: "Password" %> - -
-
- <%= f.button "Log in", class: "ui blue submit button" %> - <% end %> -
-
-
- - Sign Up -
-
-
-
- Or -
-
-
-