From 65debf0e9fe5a4995422c79c5512d5e3d19c1db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Hasi=C5=84ski?= Date: Thu, 5 Mar 2026 01:34:35 +0100 Subject: [PATCH] fix: update stale CSS class names and improve local dev experience - Rename library__book / book__cover CSS classes to library__report / report__cover to match templates updated in the Writebook-to-Dill rename - Redirect post-login to /reports instead of / (landing page) - Add email/password login form on sign-in page in development mode --- app/assets/stylesheets/books.css | 8 ++++---- app/assets/stylesheets/library.css | 4 ++-- app/controllers/concerns/authentication.rb | 2 +- app/views/sessions/new.html.erb | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/books.css b/app/assets/stylesheets/books.css index d617540..e50165a 100644 --- a/app/assets/stylesheets/books.css +++ b/app/assets/stylesheets/books.css @@ -43,7 +43,7 @@ } } -.book__cover { +.report__cover { background-color: var(--color-bg); border-radius: 0.3em; box-shadow: 0 0 0 1px var(--color-subtle-dark); @@ -109,14 +109,14 @@ } } -.book__cover--add { +.report__cover--add { inset: auto 50% calc(var(--block-space) * -1) auto; margin-inline-end: calc(var(--btn-size) * -0.5); position: absolute; z-index: 1; } -.book__cover-wrapper { +.report__cover-wrapper { color: var(--color-always-white); display: inline-grid; margin: auto; @@ -143,7 +143,7 @@ } } -.book__cover--remove { +.report__cover--remove { margin-block-start: calc(var(--block-space) * -1); z-index: 0; } diff --git a/app/assets/stylesheets/library.css b/app/assets/stylesheets/library.css index c563feb..0b273d7 100644 --- a/app/assets/stylesheets/library.css +++ b/app/assets/stylesheets/library.css @@ -8,7 +8,7 @@ padding: var(--gap); } -.library__book { +.library__report { --row-gap: calc(var(--block-space) * 0.2); container-type: inline-size; @@ -18,7 +18,7 @@ text-align: center; } -.library__book--empty { +.library__report--empty { display: inline-grid; place-items: center; diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index 1a0d6f3..35a46c7 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -63,7 +63,7 @@ def authenticated_as(session) end def post_authenticating_url - session.delete(:return_to_after_authenticating) || root_url + session.delete(:return_to_after_authenticating) || reports_url end def reset_authentication diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 3b605a3..3f8c55e 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -13,6 +13,22 @@ <%= image_tag "https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg", size: 24, alt: "Google logo" %> Sign in with Google <% end %> + + <% if Rails.env.development? %> +
+

Or sign in with email

+ <%= form_with url: session_path, class: "form" do |f| %> +
+ <%= f.label :email_address, "Email" %> + <%= f.email_field :email_address, autofocus: true, required: true, class: "input" %> +
+
+ <%= f.label :password %> + <%= f.password_field :password, required: true, class: "input" %> +
+ <%= f.submit "Sign in", class: "btn" %> + <% end %> + <% end %> <% content_for(:footer) do %>