-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add log in & sign up pages and its logic (#1)
- Loading branch information
Showing
3 changed files
with
78 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
<h2>Sign up</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
<div class="ui container"> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password %> | ||
<% if @minimum_password_length %> | ||
<em>(<%= @minimum_password_length %> characters minimum)</em> | ||
<% end %><br /> | ||
<%= f.password_field :password, autocomplete: "new-password" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Sign up" %> | ||
<div class="ui placeholder segment"> | ||
<div class="ui two column very relaxed stackable grid"> | ||
<div class="column"> | ||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: "ui form"}) do |f| %> | ||
<div class="field"> | ||
<%= f.label :email %> | ||
<div class="ui left icon input"> | ||
<%= f.email_field :email, placeholder: "Email", autofocus: true, autocomplete: "email" %> | ||
<i class="user icon"></i> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password %> | ||
<div class="ui left icon input"> | ||
<%= f.password_field :password, autocomplete: "new-password", placeholder: "Password" %> | ||
<i class="lock icon"></i> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password_confirmation %> | ||
<div class="ui left icon input"> | ||
<%= f.password_field :password_confirmation, autocomplete: "new-password", placeholder: "Password" %> | ||
<i class="lock icon"></i> | ||
</div> | ||
</div> | ||
<%= f.button "Sign up", class: "ui blue submit button" %> | ||
<% end %> | ||
</div> | ||
<div class="middle aligned column"> | ||
<div class="field"> | ||
<%= link_to "Log in", session_path(resource_name), class: "ui big button" %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="ui vertical divider"> | ||
Or | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<%= render "devise/shared/links" %> | ||
<!-- <%= render "devise/shared/links" %> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
<h2>Log in</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "current-password" %> | ||
</div> | ||
|
||
<% if devise_mapping.rememberable? %> | ||
<div class="field"> | ||
<%= f.check_box :remember_me %> | ||
<%= f.label :remember_me %> | ||
<div class="ui container"> | ||
<div class="ui placeholder segment"> | ||
<div class="ui two column very relaxed stackable grid"> | ||
<div class="column"> | ||
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "ui form" }) do |f| %> | ||
<div class="field"> | ||
<%= f.label :email %> | ||
<div class="ui left icon input"> | ||
<%= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "Email" %> | ||
<i class="user icon"></i> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password %> | ||
<div class="ui left icon input"> | ||
<%= f.password_field :password, autocomplete: "current-password", placeholder: "Password" %> | ||
<i class="lock icon"></i> | ||
</div> | ||
</div> | ||
<% if devise_mapping.rememberable? %> | ||
<div class="field"> | ||
<%= f.check_box :remember_me %> | ||
<%= f.label :remember_me %> | ||
</div> | ||
<% end %> | ||
<%= f.button "Log in", class: "ui blue submit button" %> | ||
<% end %> | ||
</div> | ||
<div class="middle aligned column"> | ||
<div class="field"> | ||
<%= link_to "Sign up", new_user_registration_path, class: "ui big button" %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="ui vertical divider"> | ||
Or | ||
</div> | ||
<% end %> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Log in" %> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<%= render "devise/shared/links" %> | ||
<!-- <%= render "devise/shared/links" %> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1 @@ | ||
<!-- %h2.ui.centered.header Welcome to Pretro! | ||
.ui.container | ||
.ui.placeholder.segment | ||
.ui.two.column.very.relaxed.stackable.grid | ||
.column | ||
= form_with scope: :session, class: "ui form", url: login_path do |f| | ||
.field | ||
=f.label :username | ||
.ui.left.icon.input | ||
=f.text_field :username, placeholder: "Username" | ||
%i.user.icon | ||
.field | ||
=f.label :password | ||
.ui.left.icon.input | ||
=f.text_field :password, placeholder: "Password" | ||
%i.lock.icon | ||
= f.button "Log in", class: "ui blue submit button" | ||
.middle.aligned.column | ||
.ui.big.button | ||
%i.signup.icon | ||
Sign Up | ||
.ui.vertical.divider | ||
Or --> | ||
<h2 class="ui centered header">Welcome to Pretro!</h2> | ||
<div class="ui container"> | ||
<div class="ui placeholder segment"> | ||
<div class="ui two column very relaxed stackable grid"> | ||
<div class="column"> | ||
<%= form_with scope: :session, class: "ui form", url: user_session_path, html: { method: :post } do |f| %> | ||
<div class="field"> | ||
<%= f.label :email %> | ||
<div class="ui left icon input"> | ||
<%= f.text_field :email, placeholder: "Email" %> | ||
<i class="user icon"></i> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :password %> | ||
<div class="ui left icon input"> | ||
<%= f.text_field :password, placeholder: "Password" %> | ||
<i class="lock icon"></i> | ||
</div> | ||
</div> | ||
<%= f.button "Log in", class: "ui blue submit button" %> | ||
<% end %> | ||
</div> | ||
<div class="middle aligned column"> | ||
<div class="ui big button"> | ||
<i class="signup icon"></i> | ||
Sign Up | ||
</div> | ||
</div> | ||
</div> | ||
<div class="ui vertical divider"> | ||
Or | ||
</div> | ||
</div> | ||
</div> | ||
|