Skip to content

Commit

Permalink
fixes formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sdellis committed Feb 24, 2025
1 parent c43cb88 commit 8e72642
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 76 deletions.
68 changes: 35 additions & 33 deletions lib/dpul_collections_web/components/footer_component.ex
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
# lib/my_app_web/components/header_component.ex
defmodule DpulCollectionsWeb.FooterComponent do
use DpulCollectionsWeb, :html
import DpulCollectionsWeb.Gettext

def footer(assigns) do
~H"""
<footer class="text-white flex flex-wrap sm:flex-row gap-10 items-center bg-gray-700 px-6 py-6 sm:py-10 sm:px-8 lg:px-10">
<div class="footer-links flex-none w-32 sm:w-60">
<ul class="text-xs">
<li class="py-1">
<a href="https://library.princeton.edu/about/policies/copyright-and-permissions-policies">
<%= gettext("Copyright Policy") %>
</a></li>
<li class="py-1">
<a href="https://www.princeton.edu/privacy-notice">
<%= gettext("Privacy Notice") %>
</a></li>
<li class="py-1">
<a href="https://accessibility.princeton.edu/help">
<%= gettext("Accessibility Help") %>
</a>
</li>
</ul>
</div>
<div class="app_name sm:flex-1 flex-none text-center">
© 2025 <%= gettext("The Trustees of Princeton University") %>
</div>
<div class="university-logo flex-none w-24 sm:w-48">
<img src={~p"/images/university-logo.svg"} alt="Princeton University Logo" />
</div>
</footer>
"""
end
end
use DpulCollectionsWeb, :html
import DpulCollectionsWeb.Gettext

def footer(assigns) do
~H"""
<footer class="text-white flex flex-wrap sm:flex-row gap-10 items-center bg-gray-700 px-6 py-6 sm:py-10 sm:px-8 lg:px-10">
<div class="footer-links flex-none w-32 sm:w-60">
<ul class="text-xs">
<li class="py-1">
<a href="https://library.princeton.edu/about/policies/copyright-and-permissions-policies">
<%= gettext("Copyright Policy") %>
</a>
</li>
<li class="py-1">
<a href="https://www.princeton.edu/privacy-notice">
<%= gettext("Privacy Notice") %>
</a>
</li>
<li class="py-1">
<a href="https://accessibility.princeton.edu/help">
<%= gettext("Accessibility Help") %>
</a>
</li>
</ul>
</div>
<div class="app_name sm:flex-1 flex-none text-center">
© 2025 <%= gettext("The Trustees of Princeton University") %>
</div>
<div class="university-logo flex-none w-24 sm:w-48">
<img src={~p"/images/university-logo.svg"} alt="Princeton University Logo" />
</div>
</footer>
"""
end
end
93 changes: 51 additions & 42 deletions lib/dpul_collections_web/components/header_component.ex
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
# lib/my_app_web/components/header_component.ex
defmodule DpulCollectionsWeb.HeaderComponent do
use DpulCollectionsWeb, :html
import DpulCollectionsWeb.Gettext

def header(assigns) do
~H"""
<header class="flex flex-row gap-10 items-center bg-gray-700 px-6 py-6 sm:py-10 sm:px-8 lg:px-10">
<div class="logo flex-none w-32 sm:w-60">
<img src={~p"/images/pul-logo.svg"} alt="Princeton University Library Logo" />
</div>
<div class="app_name flex-1">
<.link navigate={~p"/"} class="text-2xl hidden sm:inline-block text-white hover:underline hover:underline-offset-8 hover:decoration-orange-500 hover:decoration-2">
<%= gettext("Digital Collections") %>
</.link>
</div>
<div class="menu flex-none">
<div class="dropdown relative inline-block">
<button id="dropdownButton"
class="text-white hover:underline hover:underline-offset-8 hover:decoration-orange-500 hover:decoration-2"
aria-haspopup="true"
aria-expanded="false"
phx-click={JS.toggle(to: "#dropdownMenu")}>
<%= gettext("Language") %>
</button>
<ul id="dropdownMenu"
phx-click-away={JS.hide(to: "#dropdownMenu")}
class="dropdown-menu aria-hidden hidden absolute left-auto right-0 list-none bg-white w-150 py-2 px-0 mt-2 shadow-md rounded-md" role="menu" aria-hidden="true">
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=en">English</a>
</li>
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=es">Español</a>
</li>
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=pt-BR">Português do Brasil</a>
</li>
</ul>
</div>
</div>
</header>
"""
end
end
use DpulCollectionsWeb, :html
import DpulCollectionsWeb.Gettext

def header(assigns) do
~H"""
<header class="flex flex-row gap-10 items-center bg-gray-700 px-6 py-6 sm:py-10 sm:px-8 lg:px-10">
<div class="logo flex-none w-32 sm:w-60">
<img src={~p"/images/pul-logo.svg"} alt="Princeton University Library Logo" />
</div>
<div class="app_name flex-1">
<.link
navigate={~p"/"}
class="text-2xl hidden sm:inline-block text-white hover:underline hover:underline-offset-8 hover:decoration-orange-500 hover:decoration-2"
>
<%= gettext("Digital Collections") %>
</.link>
</div>
<div class="menu flex-none">
<div class="dropdown relative inline-block">
<button
id="dropdownButton"
class="text-white hover:underline hover:underline-offset-8 hover:decoration-orange-500 hover:decoration-2"
aria-haspopup="true"
aria-expanded="false"
phx-click={JS.toggle(to: "#dropdownMenu")}
>
<%= gettext("Language") %>
</button>
<ul
id="dropdownMenu"
phx-click-away={JS.hide(to: "#dropdownMenu")}
class="dropdown-menu aria-hidden hidden absolute left-auto right-0 list-none bg-white w-150 py-2 px-0 mt-2 shadow-md rounded-md"
role="menu"
aria-hidden="true"
>
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=en">English</a>
</li>
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=es">Español</a>
</li>
<li role="menuitem" tabindex="-1" class="p-2 hover:bg-stone-200 focus:bg-stone-200">
<a href="?locale=pt-BR">Português do Brasil</a>
</li>
</ul>
</div>
</div>
</header>
"""
end
end
5 changes: 4 additions & 1 deletion lib/dpul_collections_web/components/layouts/root.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
<body class="bg-white antialiased">
<a
class="transition left-0 bg-primary bg-gray-200 text-primary-content absolute p-3 m-3 -translate-y-16 focus:translate-y-0"
href="#main-content">Skip To Content</a>
href="#main-content"
>
Skip To Content
</a>
<div class="flex flex-col min-h-screen" id="app">
<%= DpulCollectionsWeb.HeaderComponent.header(assigns) %>
<div class="flex-1">
Expand Down

0 comments on commit 8e72642

Please sign in to comment.