Skip to content

Commit

Permalink
Add logo and favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadser committed Jul 16, 2024
1 parent 5d88783 commit 2413b4e
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 59 deletions.
Binary file added app/assets/images/favicon.ico
Binary file not shown.
Binary file added app/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 37 additions & 31 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,45 @@
</head>
<body class="bg-gray-100 flex items-center justify-center h-screen">
<div class="w-full max-w-md">
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4" }) do |form| %>
<%= form.hidden_field :role, value: "user" %>
<h2 class="text-2xl font-bold mb-6 text-center">Sign Up</h2>

<% if resource.errors.any? %>
<div class="mb-4 bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">Oops!</strong>
<% resource.errors.full_messages.each do |msg| %>
<span class="block sm:inline"><%= msg %></span><br>
<% end %>
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center mb-6">
<img src="/assets/logo.png" />
<%= image_tag asset_path('logo.png'), alt: 'Logo', class: 'h-16 w-16' %>
</div>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "w-full" }) do |form| %>
<%= form.hidden_field :role, value: "user" %>
<h2 class="text-2xl font-bold mb-6 text-center">Sign Up</h2>

<% if resource.errors.any? %>
<div class="mb-4 bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert">
<strong class="font-bold">Oops!</strong>
<% resource.errors.full_messages.each do |msg| %>
<span class="block sm:inline"><%= msg %></span><br>
<% end %>
</div>
<% end %>

<div class="mb-4">
<%= form.label :email, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.email_field :email, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="mb-4">
<%= form.label :password, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="mb-6">
<%= form.label :password_confirmation, "Confirm Password", class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password_confirmation, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="flex items-center justify-between">
<%= form.submit "Sign Up", class: "bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
<%= link_to "Sign In", new_session_path(resource_name), class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" %>
</div>
<% end %>

<div class="mb-4">
<%= form.label :email, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.email_field :email, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="mb-4">
<%= form.label :password, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="mb-6">
<%= form.label :password_confirmation, "Confirm Password", class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password_confirmation, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<div class="flex items-center justify-between">
<%= form.submit "Sign Up", class: "bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
<%= link_to "Sign In", new_session_path(resource_name), class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" %>
</div>
<% end %>
</div>
</div>
</body>
</html>
59 changes: 32 additions & 27 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</head>
<body class="bg-gray-100 flex items-center justify-center h-screen">
<div class="w-full max-w-md">
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4" }) do |form| %>
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="flex justify-center mb-6">
<%= image_tag asset_path('logo.png'), alt: 'Logo', class: 'h-16 w-16' %>
</div>
<h2 class="text-2xl font-bold mb-6 text-center">Sign In</h2>

<% if flash[:alert] %>
Expand All @@ -18,36 +21,38 @@
</div>
<% end %>

<div class="mb-4">
<%= form.label :email, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.email_field :email, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", required: true, autofocus: true %>
</div>

<div class="mb-6">
<%= form.label :password, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<% if devise_mapping.rememberable? %>
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: "w-full" }) do |form| %>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="user_remember_me">
<%= form.check_box :remember_me, class: "mr-2 leading-tight" %>
Remember me
</label>
<%= form.label :email, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.email_field :email, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline", required: true, autofocus: true %>
</div>

<div class="mb-6">
<%= form.label :password, class: "block text-gray-700 text-sm font-bold mb-2" %>
<%= form.password_field :password, class: "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline", required: true %>
</div>

<% if devise_mapping.rememberable? %>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="user_remember_me">
<%= form.check_box :remember_me, class: "mr-2 leading-tight" %>
Remember me
</label>
</div>
<% end %>

<div class="flex items-center justify-between">
<%= form.submit "Sign In", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
<% if devise_mapping.recoverable? && controller_name != 'sessions' %>
<%= link_to "Forgot Password?", new_password_path(resource_name), class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" %>
<% end %>
</div>
<% end %>

<div class="flex items-center justify-between">
<%= form.submit "Sign In", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
<% if devise_mapping.recoverable? && controller_name != 'sessions' %>
<%= link_to "Forgot Password?", new_password_path(resource_name), class: "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" %>
<% end %>
</div>
<% end %>

<p class="text-center mt-4">
Don't have an account? <%= link_to "Sign Up", new_registration_path(resource_name), class: "font-bold text-sm text-blue-500 hover:text-blue-800" %>
</p>
<p class="text-center mt-4">
Don't have an account? <%= link_to "Sign Up", new_registration_path(resource_name), class: "font-bold text-sm text-blue-500 hover:text-blue-800" %>
</p>
</div>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion app/views/layouts/_signed_in_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
>
<div class="py-4 text-gray-500 dark:text-gray-400">
<a
class="ml-6 text-lg font-bold text-gray-800 dark:text-gray-200"
class="ml-6 text-lg font-bold text-gray-800 dark:text-gray-200 flex items-center"
href="#"
>
<%= image_tag asset_path('logo.png'), alt: 'Logo', class: 'h-8 w-8 mr-2' %>
Llamagator
</a>
<ul class="mt-6">
Expand Down
4 changes: 4 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Llamagator</title>

<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
Expand All @@ -21,6 +22,9 @@
src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js"
defer
></script>

<link rel="icon" href="<%= asset_path 'favicon.ico' %>" type="image/x-icon">
<link rel="shortcut icon" href="<%= asset_path 'favicon.ico' %>" type="image/x-icon">
</head>
<body>
<% if current_user %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/devise.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>

<link rel="icon" href="<%= asset_path 'favicon.ico' %>" type="image/x-icon">
<link rel="shortcut icon" href="<%= asset_path 'favicon.ico' %>" type="image/x-icon">
</head>
<body>
<%= yield %>
Expand Down

0 comments on commit 2413b4e

Please sign in to comment.