Fix devise views styling

This commit is contained in:
Eugene Burmakin 2025-10-04 18:26:41 +02:00
parent 0a61f9bf68
commit 8389cd85a3
5 changed files with 42 additions and 44 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,28 +1,26 @@
<div class="hero min-h-content bg-base-200 dark:bg-gray-900">
<div class="hero min-h-content bg-base-200">
<div class="hero-content flex-col lg:flex-row-reverse w-full my-10">
<div class="text-center lg:text-left">
<% if @invitation %>
<h1 class="text-5xl font-bold text-gray-900 dark:text-gray-100">Join <%= @invitation.family.name %>!</h1>
<p class="py-6 text-gray-700 dark:text-gray-300">
<h1 class="text-5xl font-bold text-base-content">Join <%= @invitation.family.name %>!</h1>
<p class="py-6 text-base-content opacity-70">
You've been invited by <strong><%= @invitation.invited_by.email %></strong> to join their family.
Create your account to accept the invitation and start sharing location data.
</p>
<div class="bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded-lg p-4 mb-4">
<div class="flex items-center">
<svg class="h-5 w-5 text-blue-400 mr-2" fill="currentColor" viewBox="0 0 20 20">
<div class="alert alert-info mb-4">
<svg class="h-5 w-5 mr-2" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
</svg>
<span class="text-sm text-blue-800 dark:text-blue-200">
<span class="text-sm">
Your email (<%= @invitation.email %>) will be used for this account
</span>
</div>
</div>
<% else %>
<h1 class="text-5xl font-bold text-gray-900 dark:text-gray-100">Register now!</h1>
<p class="py-6 text-gray-700 dark:text-gray-300">and take control over your location data.</p>
<h1 class="text-5xl font-bold text-base-content">Register now!</h1>
<p class="py-6 text-base-content opacity-70">and take control over your location data.</p>
<% end %>
</div>
<div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100 dark:bg-gray-800 px-5 py-5">
<div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100 px-5 py-5">
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), class: 'form-body', html: { data: { turbo: session[:dawarich_client] == 'ios' ? false : true } }) do |f| %>
<% if @invitation %>
<%= f.hidden_field :invitation_token, value: params[:invitation_token] %>
@ -30,31 +28,31 @@
<div class="form-control">
<%= f.label :email, class: 'label' do %>
<span class="label-text text-gray-900 dark:text-gray-100">Email</span>
<span class="label-text">Email</span>
<% end %>
<%= f.email_field :email, autofocus: true, autocomplete: "email",
readonly: @invitation.present?,
class: "input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600 #{@invitation ? 'bg-gray-50 dark:bg-gray-600' : ''}" %>
class: "input input-bordered #{@invitation ? 'input-disabled' : ''}" %>
</div>
<div class="form-control">
<%= f.label :password, class: 'label' do %>
<span class="label-text text-gray-900 dark:text-gray-100">Password</span>
<span class="label-text">Password</span>
<% end %>
<% if @minimum_password_length %>
<em class="text-gray-600 dark:text-gray-400">(<%= @minimum_password_length %> characters minimum)</em>
<em class="text-base-content opacity-60 text-sm">(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "new-password", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<%= f.password_field :password, autocomplete: "new-password", class: 'input input-bordered' %>
</div>
<div class="form-control">
<%= f.label :password_confirmation, class: 'label' do %>
<span class="label-text text-gray-900 dark:text-gray-100">Password Confirmation</span>
<span class="label-text">Password Confirmation</span>
<% end %>
<% if @minimum_password_length %>
<em class="text-gray-600 dark:text-gray-400">(<%= @minimum_password_length %> characters minimum)</em>
<em class="text-base-content opacity-60 text-sm">(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input input-bordered' %>
</div>
<% if !DawarichSettings.self_hosted? %>
@ -63,7 +61,7 @@
<div class="form-control mt-6">
<%= f.submit (@invitation ? "Create Account & Join Family" : "Sign up"),
class: 'btn btn-primary bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white border-none' %>
class: 'btn btn-primary' %>
</div>
<% unless @invitation %>

View file

@ -1,29 +1,29 @@
<div class="hero min-h-content bg-base-200 dark:bg-gray-900">
<div class="hero min-h-content bg-base-200">
<div class="hero-content flex-col lg:flex-row-reverse w-full my-10">
<div class="text-center lg:text-left">
<% if @invitation %>
<h1 class="text-5xl font-bold text-gray-900 dark:text-gray-100">Sign in to join <%= @invitation.family.name %>!</h1>
<p class="py-6 text-gray-700 dark:text-gray-300">
<h1 class="text-5xl font-bold text-base-content">Sign in to join <%= @invitation.family.name %>!</h1>
<p class="py-6 text-base-content opacity-70">
You've been invited by <strong><%= @invitation.invited_by.email %></strong> to join their family.
Sign in to your account to accept the invitation.
</p>
<div class="bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 rounded-lg p-4">
<p class="text-sm text-blue-800 dark:text-blue-200">
<div class="alert alert-info">
<p class="text-sm">
Don't have an account yet?
<%= link_to "Create one here", new_user_registration_path(invitation_token: @invitation.token), class: "font-semibold underline" %>
</p>
</div>
<% else %>
<h1 class="text-5xl font-bold text-gray-900 dark:text-gray-100">Login now</h1>
<p class="py-6 text-gray-700 dark:text-gray-300">and take control over your location data.</p>
<h1 class="text-5xl font-bold text-base-content">Login now</h1>
<p class="py-6 text-base-content opacity-70">and take control over your location data.</p>
<% if ENV['DEMO_ENV'] == 'true' %>
<p class="py-6 text-gray-700 dark:text-gray-300">
<p class="py-6 text-base-content opacity-70">
Demo account: <strong class="text-success">demo@dawarich.app</strong> / password: <strong class="text-success">password</strong>
</p>
<% end %>
<% end %>
</div>
<div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100 dark:bg-gray-800 px-5 py-5">
<div class="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100 px-5 py-5">
<%= form_for(resource, as: resource_name, url: session_path(resource_name), class: 'form-body', html: { data: { turbo: session[:dawarich_client] == 'ios' ? false : true } }) do |f| %>
<% if @invitation %>
<%= hidden_field_tag :invitation_token, params[:invitation_token] %>
@ -31,26 +31,26 @@
<div class="form-control">
<%= f.label :email, class: 'label' do %>
<span class="label-text text-gray-900 dark:text-gray-100">Email</span>
<span class="label-text">Email</span>
<% end %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'input input-bordered' %>
</div>
<div class="form-control">
<%= f.label :password, class: 'label' do %>
<span class="label-text text-gray-900 dark:text-gray-100">Password</span>
<span class="label-text">Password</span>
<% end %>
<%= f.password_field :password, autocomplete: "current-password", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<%= f.password_field :password, autocomplete: "current-password", class: 'input input-bordered' %>
<% if devise_mapping.rememberable? %>
<div class="form-control">
<label class="label cursor-pointer">
<span class="label-text text-gray-900 dark:text-gray-100">Remember me</span>
<span class="label-text">Remember me</span>
<%= f.check_box :remember_me, class: 'checkbox checkbox-sm' %>
</label>
</div>
<% end %>
</div>
<div class="form-control mt-6">
<%= f.submit (@invitation ? "Sign in & Accept Invitation" : "Log in"), class: 'btn btn-primary bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white border-none' %>
<%= f.submit (@invitation ? "Sign in & Accept Invitation" : "Log in"), class: 'btn btn-primary' %>
</div>
<% unless @invitation %>

View file

@ -191,7 +191,7 @@
<%= link_to family_invitation_path(@family, invitation),
method: :delete,
data: { confirm: 'Are you sure you want to cancel this invitation?', turbo_confirm: 'Are you sure you want to cancel this invitation?' },
class: "text-error hover:brightness-90 text-sm font-medium" do %>
class: "btn btn-outline btn-warning btn-sm opacity-70" do %>
Cancel
<% end %>
<% end %>

View file

@ -14,7 +14,7 @@
You've been invited by <strong class="text-base-content"><%= @invitation.invited_by.email %></strong> to join their family. Create your account to accept the invitation and start sharing location data.
</p>
<div class="alert alert-info inline-flex rounded-full px-4 py-2 mt-4">
<div class="alert alert-info inline-flex rounded-lg px-4 py-2 mt-4">
<%= icon 'info', class: "h-5 w-5 mr-2" %>
<span class="text-sm font-medium">
Your email (<%= @invitation.email %>) will be used for this account
@ -142,7 +142,7 @@
<% end %>
<div class="text-center">
<p class="text-sm text-base-content opacity-60 mb-2">
<p class="text-sm text-gray-300 mb-2">
Already have an account?
</p>
<%= link_to new_user_session_path(invitation_token: @invitation.token),