Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from malparty/feature/user-login-frontend
[#16] [Frontend] As a User, I can sign up and sign in/out with a username and password
- Loading branch information
Showing
28 changed files
with
321 additions
and
168 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
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
// Base | ||
|
||
// Layouts | ||
@import 'layouts/default'; | ||
|
||
// Components | ||
|
||
|
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.layout-default { | ||
.app-footer { | ||
width: 100%; | ||
height: 60px; | ||
margin-top: 2rem; | ||
line-height: 60px; | ||
background-color: $gray-100; | ||
} | ||
} |
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
Empty file.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<%= form_for(resource, as: resource_name, | ||
url: registration_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="row"> | ||
<div class="col-12 col-md-6"> | ||
<div class="form-group"> | ||
<%= f.label :first_name %><br/> | ||
<%= f.text_field :first_name, autofocus: true, class: 'form-control' %> | ||
</div> | ||
</div> | ||
<div class="col-12 col-md-6"> | ||
<div class="form-group"> | ||
<%= f.label :last_name %><br/> | ||
<%= f.text_field :last_name, class: 'form-control' %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12 col-md-6"> | ||
<%= f.label :email %> | ||
<div class="form-group"> | ||
<%= f.email_field :email, autocomplete: 'email', class: 'form-control' %> | ||
</div> | ||
|
||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> | ||
<div><%= t('waiting_confirmation_for') %>: <%= resource.unconfirmed_email %></div> | ||
<% end %> | ||
</div> | ||
<div class="col-12 col-md-6"> | ||
<div class="form-group"> | ||
<%= f.label :current_password %> | ||
<%= f.password_field :current_password, autocomplete: 'current-password', class: 'form-control' %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<a class="btn btn-link" | ||
data-toggle="collapse" | ||
href="#newPassword" | ||
role="button" | ||
aria-expanded="false" | ||
aria-controls="newPassword"> | ||
Set a new password | ||
</a> | ||
</div> | ||
<div class="collapse" id="newPassword"> | ||
<% if @minimum_password_length %> | ||
<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em> | ||
<% end %> | ||
<div class="row"> | ||
<div class="col-12 col-md-6"> | ||
<div class="form-group"> | ||
<%= f.label :password %> <br/> | ||
<%= f.password_field :password, autocomplete: "new-password", class: 'form-control' %> | ||
</div> | ||
</div> | ||
<div class="col-12 col-md-6"> | ||
<div class="form-group"> | ||
<%= f.label :password_confirmation %><br/> | ||
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= f.submit t('update'), class: 'btn btn-primary btn-block' %> | ||
<% end %> |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="form-group"> | ||
<%= f.label :first_name %><br/> | ||
<%= f.text_field :first_name, autofocus: true, class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :last_name %><br/> | ||
<%= f.text_field :last_name, class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :email %><br/> | ||
<%= f.email_field :email, autocomplete: 'email', class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password %><br/> | ||
<% if @minimum_password_length %> | ||
<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em> | ||
<% end %><br/> | ||
<%= f.password_field :password, autocomplete: 'new-password', class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.label :password_confirmation %><br/> | ||
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %> | ||
</div> | ||
<div class="form-group"> | ||
<%= f.submit t('auth.sign_up'), class: 'btn btn-primary btn-block' %> | ||
</div> | ||
<% end %> |
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,53 +1,29 @@ | ||
<h2>Edit <%= resource_name.to_s.humanize %></h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="field"> | ||
<%= f.label :first_name %><br /> | ||
<%= f.text_field :first_name, autofocus: true %> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col col-md-12 col-lg-8"> | ||
<div class="card"> | ||
<section class="card-body"> | ||
<h2>Edit <%= resource_name.to_s.humanize %></h2> | ||
|
||
<%= render 'edit_form' %> | ||
</section> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :last_name %><br /> | ||
<%= f.text_field :last_name %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autocomplete: "email" %> | ||
<div class="row justify-content-center mt-2"> | ||
<div class="col col-md-6 col-lg-4"> | ||
<div class="card"> | ||
<section class="card-body"> | ||
<h3>Cancel my account</h3> | ||
|
||
<p><%= t('unhappy') %>? 🥺</p> | ||
<%= button_to t('auth.cancel_my_account'), | ||
registration_path(resource_name), | ||
data: { confirm: t('confirm') }, | ||
method: :delete, | ||
class: 'btn btn-danger btn-block' %> | ||
</section> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> | ||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div> | ||
<% end %> | ||
|
||
<div class="field"> | ||
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br /> | ||
<%= f.password_field :password, autocomplete: "new-password" %> | ||
<% if @minimum_password_length %> | ||
<br /> | ||
<em><%= @minimum_password_length %> characters minimum</em> | ||
<% end %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> | ||
<%= f.password_field :current_password, autocomplete: "current-password" %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Update" %> | ||
</div> | ||
<% end %> | ||
|
||
<h3>Cancel my account</h3> | ||
|
||
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p> | ||
|
||
<%= link_to "Back", :back %> | ||
</div> |
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,39 +1,14 @@ | ||
<h2>Sign up</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="field"> | ||
<%= f.label :first_name %><br /> | ||
<%= f.text_field :first_name, autofocus: true %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :last_name %><br /> | ||
<%= f.text_field :last_name %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, 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> | ||
<% end %> | ||
<%= render "devise/shared/links" %> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col col-md-6 col-lg-4"> | ||
<div class="card"> | ||
<section class="card-body"> | ||
<%= link_to t('auth.sign_in'), new_session_path(resource_name), class: 'float-right btn btn-outline-primary' %> | ||
<h4 class="card-title mb-4 mt-1">Sign up</h4> | ||
|
||
<%= render 'devise/registrations/new_form' %> | ||
</section> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.