-
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.
Merge pull request #2 from ab-noori/authentication
Authentication
- Loading branch information
Showing
11 changed files
with
139 additions
and
60 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
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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
<h2>Sign up</h2> | ||
<%= render partial: 'layouts/shared/navbar', locals: { back_destination: root_path, page_name: 'Sign Up', link: { destination: new_user_session_path, label: 'Log In' } } %> | ||
|
||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
<div class="container mt-5"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-6"> | ||
<%= 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 :email %><br /> | ||
<%= f.email_field :email, autofocus: true, autocomplete: "email" %> | ||
</div> | ||
<div class="mb-3"> | ||
<%= f.text_field :name, class: "form-control", placeholder: "Name", autocomplete: "name" %> | ||
</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="mb-3"> | ||
<%= f.email_field :email, class: "form-control", placeholder: "Email", autofocus: true, autocomplete: "email" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "new-password" %> | ||
</div> | ||
<div class="mb-3"> | ||
<%= f.password_field :password, class: "form-control", placeholder: "Password (6 characters minimum)", autocomplete: "new-password" %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Sign up" %> | ||
</div> | ||
<% end %> | ||
<div class="mb-3"> | ||
<%= f.password_field :password_confirmation, class: "form-control", placeholder: "Confirm Password", autocomplete: "new-password" %> | ||
</div> | ||
|
||
<%= render "devise/shared/links" %> | ||
<div class="text-center"> | ||
<%= f.submit "Sign up", class: "btn btn-primary btn-md" %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</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,26 +1,34 @@ | ||
<h2>Log in</h2> | ||
<%= render partial: 'layouts/shared/navbar', locals: { back_destination: root_path, page_name: 'Log In', link: { destination: new_user_registration_path, label: 'Sign Up' } } %> | ||
|
||
<%= 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="container mt-5"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-6"> | ||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div class="field"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "current-password" %> | ||
</div> | ||
<div class="mb-3"> | ||
<%= f.email_field :email, class: "form-control", placeholder: "Email", autofocus: true, autocomplete: "email" %> | ||
</div> | ||
|
||
<% if devise_mapping.rememberable? %> | ||
<div class="field"> | ||
<%= f.check_box :remember_me %> | ||
<%= f.label :remember_me %> | ||
</div> | ||
<% end %> | ||
<div class="mb-3"> | ||
<%= f.password_field :password, class: "form-control", placeholder: "Password", autocomplete: "current-password" %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Log in" %> | ||
</div> | ||
<% end %> | ||
<% if devise_mapping.rememberable? %> | ||
<div class="mb-3"> | ||
<%= f.check_box :remember_me %> | ||
<%= f.label :remember_me %> | ||
</div> | ||
<% end %> | ||
|
||
<%= render "devise/shared/links" %> | ||
<div class="mb-3"> | ||
<%= f.submit "Log in", class: "btn btn-primary btn-md" %> | ||
</div> | ||
<% end %> | ||
|
||
<div> | ||
<%= render "devise/shared/links" %> | ||
</div> | ||
</div> | ||
</div> | ||
</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
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 |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
<%= csrf_meta_tags %> | ||
<%= csp_meta_tag %> | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | ||
|
||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> | ||
<%= javascript_importmap_tags %> | ||
|
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,27 @@ | ||
<div class="container mt-4 col-md-4"> | ||
<!-- Bootstrap alert for notice --> | ||
<% if notice.present? %> | ||
<div class="alert alert-success alert-dismissible fade show" role="alert"> | ||
<%= notice %> | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
</div> | ||
<script> | ||
setTimeout(function(){ | ||
document.querySelector('.alert-success').style.display = 'none'; | ||
}, 5000); // Hide after 5 seconds (adjust as needed) | ||
</script> | ||
<% end %> | ||
|
||
<!-- Bootstrap alert for alert --> | ||
<% if alert.present? %> | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
<%= alert %> | ||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> | ||
</div> | ||
<script> | ||
setTimeout(function(){ | ||
document.querySelector('.alert-danger').style.display = 'none'; | ||
}, 5000); // Hide after 5 seconds (adjust as needed) | ||
</script> | ||
<% end %> | ||
</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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<nav class="navbar navbar-expand-lg navbar-light bg-primary bg-gradient"> | ||
<div class="container"> | ||
<% if back_destination.present? %> | ||
<a href="<%= back_destination %>" class="btn btn-link text-white"> | ||
<i class="fas fa-arrow-left fa-lg"></i> | ||
</a> | ||
<% end %> | ||
<span class="navbar-brand mx-auto text-white"><%= page_name %></span> | ||
|
||
<% if link.present? %> | ||
<a href="<%= link[:destination] %>" class="ml-2 text-white no-underline"><%= link[:label] %></a> | ||
<% end %> | ||
</div> | ||
</nav> |
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,18 +1,22 @@ | ||
<div class="container-fluid text-center"> | ||
<div class="container text-center"> | ||
<div class="row mt-5"> | ||
<div class="col-md-6 offset-md-3"> | ||
<h1 class="display-4">Welcome to Finance Tracker</h1> | ||
<img src="<%= asset_path('logo.png') %>" alt="Finance Tracker Logo" class="img-fluid my-4"> | ||
<img src="<%= asset_path('logo.png') %>" alt="Finance Tracker Logo" class="img-fluid my-4 logo-image"> | ||
<p class="lead">Track your finances with ease.</p> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6 offset-md-3"> | ||
<div class="d-grid gap-2"> | ||
<%= link_to "Sign in", new_user_session_path, class: "btn btn-primary btn-lg mb-2" %> | ||
<%= link_to "Sign up", new_user_registration_path, class: "btn btn-secondary btn-lg" %> | ||
</div> | ||
|
||
<div class="fixed-bottom text-center mb-2"> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-6 offset-md-3"> | ||
<div class="d-grid gap-1"> | ||
<%= link_to "Sign in", new_user_session_path, class: "btn btn-primary btn-lg mb-1" %> | ||
<%= link_to "Sign up", new_user_registration_path, class: "btn btn-success btn-lg" %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</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
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