Skip to content

Commit

Permalink
Merge in design from normal sign in page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Oct 15, 2024
1 parent 60b1f2a commit 5b1989c
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions app/views/alerts/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<%# TODO: Obviously this needs to be made to look like the design %>

<%= render HeadingComponent.new(tag: :h1).with_content("Sign in to save this search") %>
<div class="max-w-lg mx-auto">
<%= render HeadingComponent.new(tag: :h1, extra_classes: "mt-20 mb-12 text-center") do %>
Sign in to save this search
<% end %>

<p>
Applications within <%= meters_in_words(@alert.radius_meters) %> of <%= @alert.address %>
</p>
<p>
Applications within <%= meters_in_words(@alert.radius_meters) %> of <%= @alert.address %>
</p>

<%= form_with model: resource, url: session_path(resource_name) do |f| %>
<%# TODO: Add error display and styling %>
<div class="flex flex-col items-center">
<div class="w-full">
<%= f.label :email, "Your email", class: "mb-1 block" %>
<%= f.email_field :email, class: "block mb-5 w-full", placeholder: "[email protected]", autofocus: true, autocomplete: "email", required: true %>
<%= form_with model: resource, url: session_path(resource_name) do |f| %>
<%# TODO: Add error display and styling %>
<div class="flex flex-col items-center">
<div class="w-full">
<%= f.label :email, "Your email", class: "mb-1 block" %>
<%= f.email_field :email, class: "block mb-5 w-full", placeholder: "[email protected]", autofocus: true, autocomplete: "email", required: true %>
</div>
<div class="w-full">
<%= f.label :password, class: "mb-1 block" %>
<%= f.password_field :password, class: "block mb-2 w-full", placeholder: "••••••••", autocomplete: "current-password", required: true %>
<%# link_to "Forgot your password?", new_password_path(resource_name), class: "text-xl text-navy font-light underline block mb-8" %>
</div>
<%= f.hidden_field :remember_me, value: true %>
<%# TODO: Is there a neater / more sensible way to pass these parameters on? %>
<%= f.hidden_field :address, value: @alert.address %>
<%= f.hidden_field :radius_meters, value: @alert.radius_meters %>
<%= f.button "Sign in" %>
</div>
<div class="w-full">
<%= f.label :password, class: "mb-1 block" %>
<%= f.password_field :password, class: "block mb-2 w-full", placeholder: "••••••••", autocomplete: "current-password", required: true %>
<%# link_to "Forgot your password?", new_password_path(resource_name), class: "text-xl text-navy font-light underline block mb-8" %>
</div>
<%= f.hidden_field :remember_me, value: true %>
<%# TODO: Is there a neater / more sensible way to pass these parameters on? %>
<%= f.hidden_field :address, value: @alert.address %>
<%= f.hidden_field :radius_meters, value: @alert.radius_meters %>
<%= f.button "Sign in" %>
</div>
<% end %>
<% end %>
</div>

0 comments on commit 5b1989c

Please sign in to comment.