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

Hacking out some UI #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.1.0
15 changes: 7 additions & 8 deletions app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
.flex.min-h-full.flex-col.justify-center.py-12.sm:px-6.lg:px-8
.sm:mx-auto.sm:w-full.sm:max-w-md
%img.mx-auto.h-12.w-auto{alt: "Your Company", src: url_for('/assets/logo_black.png')}
%img.mx-auto.h-10.w-auto{alt: "Your Company", src: url_for('/assets/logo_black.png')}
%h2.mt-6.text-center.text-3xl.tracking-tight.text-gray-900.font-serif Create your account
%p.mt-2.text-center.text-sm.text-gray-600
Or
%a.font-medium.text-emerald-700.hover:text-emerald-500{href: new_user_session_path} Sign in
%a.font-medium.text-emerald-700.hover:text-emerald-800{href: new_user_session_path} Sign in
.mt-8.sm:mx-auto.sm:w-full.sm:max-w-md
.bg-white.py-8.px-4.shadow.sm:rounded-lg.sm:px-10
= form_for(resource, as: resource_name, url: url: registration_path(@user), method: :put, html: { class: 'space-y-6'}) do |f|
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a method: :put here accidentally - that's causing the error I think - its going to the wrong place

.bg-white.py-8.px-4.shadow-xl.sm:rounded-xl.sm:px-10
= form_for(resource, as: resource_name, url: registration_path(@user), method: :put, html: { class: 'space-y-6'}) do |f|
= render "devise/shared/error_messages", resource: resource
%div
%label.block.text-sm.font-medium.text-gray-700{for: "email"} Email address
.mt-1
= f.email_field :email, autofocus: true, autocomplete: "email",class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm{autocomplete: "email", name: "email", required: "", type: "email"}'
= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: 'Your email', class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm'

%div
%label.block.text-sm.font-medium.text-gray-700{for: "password"} Password
.mt-1

= f.password_field :password, autocomplete: "new-password",class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm{autocomplete: "current-password", name: "password", required: "", type: "password"}'
= f.password_field :password, autocomplete: "new-password", placeholder: 'Super strong password', class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm'


%div
= f.submit "Sign up", class: 'flex w-full justify-center rounded-md border border-transparent bg-emerald-800 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-emerald-900 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2{type: "submit"}'
= f.submit "Sign up", class: 'flex w-full justify-center rounded-md border border-transparent bg-emerald-700 py-2 px-4 text-sm font-medium text-emerald-50 shadow-sm transition hover:bg-emerald-800 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2'

.mt-6
.relative
Expand Down
21 changes: 12 additions & 9 deletions app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
.flex.min-h-full.flex-col.justify-center.py-12.sm:px-6.lg:px-8
.sm:mx-auto.sm:w-full.sm:max-w-md
%img.mx-auto.h-12.w-auto{alt: "Your Company", src: url_for('/assets/logo_black.png')}
%img.mx-auto.h-10.w-auto{alt: "Your Company", src: url_for('/assets/logo_black.png')}
%h2.mt-6.text-center.text-3xl.tracking-tight.text-gray-900.font-serif Sign in
%p.mt-2.text-center.text-sm.text-gray-600
Or
%a.font-medium.text-emerald-700.hover:text-emerald-500{href: new_user_registration_path} Create your Account
%a.font-medium.text-emerald-700.hover:text-emerald-800{href: new_user_registration_path} Create your Account
.mt-8.sm:mx-auto.sm:w-full.sm:max-w-md
.bg-white.py-8.px-4.shadow.sm:rounded-lg.sm:px-10
.bg-white.py-8.px-4.shadow-xl.sm:rounded-xl.sm:px-10
= form_for(resource, as: resource_name, url: session_path(resource_name),data: { turbo: false }, html: { class: 'space-y-6'}) do |f|
= render "devise/shared/error_messages", resource: resource
%div
%label.block.text-sm.font-medium.text-gray-700{for: "email"} Email address
.mt-1
= f.email_field :email, autofocus: true, autocomplete: "email",class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm{autocomplete: "email", name: "email", required: "", type: "email"}'
= f.email_field :email, autofocus: true, autocomplete: "email", required: true, placeholder: 'Your amazing email', class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-700 focus:outline-none focus:ring-emerald-700 sm:text-sm'

%div
%label.block.text-sm.font-medium.text-gray-700{for: "password"} Password
.mt-1

= f.password_field :password, autocomplete: "new-password",class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm{autocomplete: "current-password", name: "password", required: "", type: "password"}'
= f.password_field :password, autocomplete: "new-password", required: true, placeholder: 'Your top secret password', class: '#block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-emerald-500 sm:text-sm'

.flex.items-center.justify-between
.flex.items-center
= f.check_box :remember_me, id: 'remember-me', class: 'h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500{name: "remember-me", type: "checkbox"}'
= f.check_box :remember_me, id: 'remember-me', class: 'h-4 w-4 rounded border-gray-300 text-emerald-600 focus:ring-emerald-500'

%label.ml-2.block.text-sm.text-gray-900{for: "remember-me"} Remember me
.text-sm
%a.font-medium.text-emerald-700.hover:text-emerald-500{href: new_password_path(resource_name)} Forgot your password?
%a.font-medium.text-emerald-700.hover:text-emerald-800{href: new_password_path(resource_name)} Forgot your password?
%div
%button.flex.w-full.justify-center.rounded-md.border.border-transparent.bg-emerald-800.py-2.px-4.text-sm.font-medium.text-white.shadow-sm.hover:bg-emerald-900.focus:outline-none.focus:ring-2.focus:ring-emerald-500.focus:ring-offset-2{type: "submit"} Sign in
= f.submit "Sign in", class: 'group relative w-full text-emerald-50 transition flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md bg-emerald-700 hover:bg-emerald-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-emerald-500'
-# %button.flex.w-full.justify-center.rounded-md.border.border-transparent.bg-emerald-800.py-2.px-4.text-sm.font-medium.text-white.shadow-sm.hover:bg-emerald-900.focus:outline-none.focus:ring-2.focus:ring-emerald-500.focus:ring-offset-2{type: "submit"} Sign in
.mt-6
.relative
.absolute.inset-0.flex.items-center
Expand All @@ -37,4 +38,6 @@
%span.bg-white.px-2.text-gray-500
.mt-6.justify-center
%div
= render "devise/shared/links"
= render "devise/shared/links"

.g_id_signin{"data-logo_alignment" => "left", "data-shape" => "rectangular", "data-size" => "large", "data-text" => "sign_in_with", "data-theme" => "outline", "data-type" => "standard"}
2 changes: 1 addition & 1 deletion app/views/layouts/devise.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
= stylesheet_link_tag "application", "data-turbo-track": "reload"
= javascript_importmap_tags
%script{:src => "https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"}
%body.h-full
%body.h-full.bg-emerald-50
= yield