Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reroute to develop [#16] [Frontend] As a User, I can sign up and sign in/out with a username and password #43

Merged
merged 31 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
04738f3
[#16] Add UI for Sign In view
malparty Jun 15, 2021
108b846
[#16] Add basic navbar for unauthenticated user
malparty Jun 15, 2021
641c641
[#16] Add UI for alert and notice messages
malparty Jun 15, 2021
ddbd202
[#16] Fix semantic issue in sign in view
malparty Jun 15, 2021
b80de02
[#16] Add UI for Sign Up view
malparty Jun 15, 2021
c4a8c1f
[#16] Add nav bar for authenticated users
malparty Jun 15, 2021
8535445
[#16] Add UI to Users/edit view
malparty Jun 15, 2021
658863a
[#16] Add responsiveness to user edit view
malparty Jun 15, 2021
56bc027
[#16] Use translation locales
malparty Jun 15, 2021
9031f6f
[#16] Remove rspec exceptions when asset is missing in test pipeline
malparty Jun 15, 2021
b04008b
[#16] Fix tests due to Log In button renamed in Sign In
malparty Jun 15, 2021
d3e65d1
[#16] Add My Profile link to navbar
malparty Jun 15, 2021
ff1de1b
[#16] Add Footer UI
malparty Jun 15, 2021
9f23814
[#16] Extract header and footer in partial views
malparty Jun 15, 2021
5f52c41
[#16] Update footer to use flex
malparty Jun 15, 2021
942dac8
[#16] Add UI for error messages
malparty Jun 15, 2021
a8d3cab
[#16] Add margin top to footer
malparty Jun 15, 2021
a23c330
[#16] Update system tests to map error message
malparty Jun 15, 2021
c6a337c
[#16] Move footer into layout scss and shared html
malparty Jun 16, 2021
f62118b
[#16] Add empty line to logo.svg
malparty Jun 16, 2021
0af3252
[#16] Move edit/new forms into partial views
malparty Jun 16, 2021
94f4675
[#16] Add missing class to html footer
malparty Jun 16, 2021
b92a415
root commit
malparty Jun 11, 2021
2afd1e8
[#17] Reduce unused bootstrap modules
malparty Jun 16, 2021
50facc5
[#17] Update default layout scss to follow conventions
malparty Jun 16, 2021
fde4798
[#16] Remove .keep and disable some unused bootstrap modules
malparty Jun 18, 2021
f8d9119
[#16] Rename _default.scss without _ to match convention
malparty Jun 21, 2021
c797e89
[#16] Add empty lines for code clarity
malparty Jun 21, 2021
435fe27
[#16] Remove useless div
malparty Jun 21, 2021
4f9da6e
root commit
malparty Jun 11, 2021
7156ceb
root commit
malparty Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file removed app/assets/images/.keep
Empty file.
1 change: 1 addition & 0 deletions app/assets/images/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// Base

// Layouts
@import 'layouts/default';

// Components

Expand Down
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/layouts/default.scss
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;
}
}
36 changes: 18 additions & 18 deletions app/assets/stylesheets/vendor/bootstrap/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@
@import 'bootstrap/scss/reboot';
@import 'bootstrap/scss/type';
@import 'bootstrap/scss/utilities';
@import 'bootstrap/scss/images';
//@import 'bootstrap/scss/images';
@import 'bootstrap/scss/grid';
@import 'bootstrap/scss/forms';
@import 'bootstrap/scss/buttons';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/code';
@import 'bootstrap/scss/transitions';
//@import 'bootstrap/scss/tables';
//@import 'bootstrap/scss/code';
//@import 'bootstrap/scss/transitions';
@import 'bootstrap/scss/dropdown';
@import 'bootstrap/scss/button-group';
@import 'bootstrap/scss/input-group';
@import 'bootstrap/scss/custom-forms';
//@import 'bootstrap/scss/custom-forms';
@import 'bootstrap/scss/nav';
@import 'bootstrap/scss/navbar';
@import 'bootstrap/scss/card';
@import 'bootstrap/scss/breadcrumb';
//@import 'bootstrap/scss/breadcrumb';
@import 'bootstrap/scss/pagination';
@import 'bootstrap/scss/badge';
@import 'bootstrap/scss/jumbotron';
//@import 'bootstrap/scss/badge';
//@import 'bootstrap/scss/jumbotron';
@import 'bootstrap/scss/alert';
@import 'bootstrap/scss/progress';
@import 'bootstrap/scss/media';
@import 'bootstrap/scss/list-group';
@import 'bootstrap/scss/close';
@import 'bootstrap/scss/toasts';
@import 'bootstrap/scss/modal';
@import 'bootstrap/scss/tooltip';
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/carousel';
@import 'bootstrap/scss/spinners';
@import 'bootstrap/scss/print';
//@import 'bootstrap/scss/media';
//@import 'bootstrap/scss/list-group';
//@import 'bootstrap/scss/close';
//@import 'bootstrap/scss/toasts';
//@import 'bootstrap/scss/modal';
//@import 'bootstrap/scss/tooltip';
//@import 'bootstrap/scss/popover';
//@import 'bootstrap/scss/carousel';
//@import 'bootstrap/scss/spinners';
//@import 'bootstrap/scss/print';
1 change: 1 addition & 0 deletions app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h2>Resend confirmation instructions</h2>

<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
Expand Down
2 changes: 2 additions & 0 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<h2>Change your password</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<%= f.hidden_field :reset_password_token %>

<div class="field">
Expand Down
1 change: 1 addition & 0 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h2>Forgot your password?</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
Expand Down
70 changes: 70 additions & 0 deletions app/views/devise/registrations/_edit_form.html.erb
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 %>
Copy link

@github-actions github-actions bot Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Replace instance variable with local variable

<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em>
Copy link

@github-actions github-actions bot Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Replace instance variable with local variable

<% 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 %>
31 changes: 31 additions & 0 deletions app/views/devise/registrations/_new_form.html.erb
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 %>
Copy link

@github-actions github-actions bot Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Replace instance variable with local variable

<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em>
Copy link

@github-actions github-actions bot Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Replace instance variable with local variable

<% 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 %>
78 changes: 27 additions & 51 deletions app/views/devise/registrations/edit.html.erb
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>
53 changes: 14 additions & 39 deletions app/views/devise/registrations/new.html.erb
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>
57 changes: 33 additions & 24 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
<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="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_up'), new_registration_path(resource_name),
class: 'float-right btn btn-outline-primary' %>
<h4 class="card-title mb-4 mt-1">Sign in</h4>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-group">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %>
</div>
<div class="form-group">
<%= link_to t('forgot_password'), new_password_path(resource_name), class:'float-right' %><br />
<%= f.label :password %><br />
<%= f.password_field :password, autocomplete: 'current-password', class: 'form-control' %>
</div>
<div class="form-group">
<% if devise_mapping.rememberable? %>
<div class="checkbox">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end %>
</div>
<div class="form-group">
<%= f.submit t('auth.sign_in'), class: 'btn btn-primary btn-block' %>
</div>
<% end %>
</section>
</div>
</div>
<% end %>

<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
</div>