done with login signup

This commit is contained in:
Ethan Fraenkel 2018-08-28 15:34:52 +02:00
parent d12fa2a46b
commit 6f091b96aa
6 changed files with 93 additions and 41 deletions

View File

@ -14,3 +14,6 @@
@import "layouts/index"; @import "layouts/index";
@import "components/index"; @import "components/index";
@import "pages/index"; @import "pages/index";
@import "devise/index";

View File

@ -0,0 +1 @@
@import 'login';

View File

@ -0,0 +1,40 @@
.login-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
position: absolute;
background-image:
linear-gradient(
-225deg,
rgba(5,25,55,0.3) 0%,
rgba(68,73,101,0.3),
rgba(128,129,149,0.3),
rgba(191,190,200,0.3),
rgba(255,255,255,0.3)
50%),
url('https://unsplash.com/photos/jay5BqVyf5A');
.login-content {
position: relative;
top: -10vh;
padding: 50px;
background-color: white;
width: 25vw;
border-radius: 3px;
box-shadow: 1px 1px 10px rgba(0,0,0, 0.21);
h2 {
color: $primary;
}
}
}
.login {
// color: $primary;
width:100%;
}

View File

@ -1,25 +1,29 @@
<h2>Sign up</h2> <div class="login-container">
<div class="login-content">
<h2>Sign up</h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
<div class="form-inputs"> <div class="form-inputs">
<%= f.input :email, <%= f.input :email,
required: true, required: true,
autofocus: true , autofocus: true ,
input_html: { autocomplete: "email" }%> input_html: { autocomplete: "email" }%>
<%= f.input :password, <%= f.input :password,
required: true, required: true,
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
input_html: { autocomplete: "new-password" } %> input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation, <%= f.input :password_confirmation,
required: true, required: true,
input_html: { autocomplete: "new-password" } %> input_html: { autocomplete: "new-password" } %>
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up", class: "login btn btn-primary" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
</div> </div>
</div>
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -1,20 +1,24 @@
<h2>Log in</h2> <div class="login-container">
<div class="login-content">
<h2>Log in</h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> <%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs"> <div class="form-inputs">
<%= f.input :email, <%= f.input :email,
required: false, required: false,
autofocus: true, autofocus: true,
input_html: { autocomplete: "email" } %> input_html: { autocomplete: "email" } %>
<%= f.input :password, <%= f.input :password,
required: false, required: false,
input_html: { autocomplete: "current-password" } %> input_html: { autocomplete: "current-password" } %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %> <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in", class: "login btn btn-primary" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
</div> </div>
</div>
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@ -3,7 +3,7 @@
<% end -%> <% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %> <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br /> <%#= link_to "Sign up", new_registration_path(resource_name) %><!-- <br /> -->
<% end -%> <% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>