Add footer with dynamic copyright year to all layouts

- Add footer component to app, authenticated, and admin layouts
- Update marketing layout footer to use dynamic year
- Use flexbox layout to push footer to bottom of viewport
- Footer displays 'Copyright © <year> Towerops'
- Year updates automatically using Date.utc_today().year
This commit is contained in:
Graham McIntire 2026-01-17 11:05:39 -06:00
parent b53a53b199
commit 654fcb541c
No known key found for this signature in database
2 changed files with 33 additions and 10 deletions

View file

@ -35,7 +35,7 @@ defmodule ToweropsWeb.Layouts do
def app(assigns) do
~H"""
<div class="min-h-screen bg-zinc-50 dark:bg-zinc-950">
<div class="flex min-h-screen flex-col bg-zinc-50 dark:bg-zinc-950">
<header class="border-b border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-900">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<nav class="flex h-16 items-center justify-between">
@ -62,11 +62,13 @@ defmodule ToweropsWeb.Layouts do
</div>
</header>
<main class="px-4 py-12 sm:px-6 lg:px-8">
<main class="flex-1 px-4 py-12 sm:px-6 lg:px-8">
<div class="mx-auto max-w-2xl">
{render_slot(@inner_block)}
</div>
</main>
<.footer />
</div>
<.flash_group flash={@flash} />
@ -103,7 +105,7 @@ defmodule ToweropsWeb.Layouts do
def authenticated(assigns) do
~H"""
<div class="min-h-screen bg-zinc-50 dark:bg-zinc-950">
<div class="flex min-h-screen flex-col bg-zinc-50 dark:bg-zinc-950">
<!-- Impersonation Banner -->
<%= if @current_scope && @current_scope.impersonating? do %>
<div class="bg-yellow-400 border-b-2 border-yellow-600">
@ -224,11 +226,13 @@ defmodule ToweropsWeb.Layouts do
</div>
</nav>
<main class="py-10">
<main class="flex-1 py-10">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
{render_slot(@inner_block)}
</div>
</main>
<.footer />
</div>
<.flash_group flash={@flash} />
@ -355,7 +359,7 @@ defmodule ToweropsWeb.Layouts do
def admin(assigns) do
~H"""
<main class="min-h-screen bg-zinc-50 dark:bg-zinc-950">
<div class="flex min-h-screen flex-col bg-zinc-50 dark:bg-zinc-950">
<nav class="bg-white border-b border-zinc-200 dark:border-zinc-800 dark:bg-zinc-900">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
@ -393,12 +397,31 @@ defmodule ToweropsWeb.Layouts do
</div>
</nav>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
{render_slot(@inner_block)}
</div>
</main>
<main class="flex-1">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
{render_slot(@inner_block)}
</div>
</main>
<.footer />
</div>
<.flash_group flash={@flash} />
"""
end
@doc """
Renders the application footer with copyright notice.
"""
def footer(assigns) do
~H"""
<footer class="border-t border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-900">
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
<p class="text-center text-sm text-zinc-600 dark:text-zinc-400">
Copyright © {Date.utc_today().year} Towerops
</p>
</div>
</footer>
"""
end
end

View file

@ -65,7 +65,7 @@ defmodule ToweropsWeb.MarketingLayouts do
<div class="flex flex-col items-center border-t border-slate-400/10 py-10 sm:flex-row-reverse sm:justify-between">
<div class="flex gap-x-6"></div>
<p class="mt-6 text-sm text-slate-500 sm:mt-0">
Copyright &copy; 2025 Towerops. All rights reserved.
Copyright © {Date.utc_today().year} Towerops
</p>
</div>
</div>