Skip to content

Commit

Permalink
Clean up root
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Feb 21, 2024
1 parent 9e87edb commit d63b5ed
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 105 deletions.
13 changes: 5 additions & 8 deletions lib/polar_web/components/layouts/app.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,14 @@
</div>
</div>
</nav>

<header class="bg-white shadow">
<header class="bg-slate-900 shadow">
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold tracking-tight text-slate-900">
<%= assigns[:page_title] || "Polar" %>
<h1 class="text-2xl font-bold tracking-tight text-slate-50">
<%= assigns[:page_title] || "Polar Image Server" %>
</h1>
</div>
</header>
<main>
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8">
<.flash_group flash={@flash} />
<%= @inner_content %>
</div>
<.flash_group flash={@flash} />
<%= @inner_content %>
</main>
2 changes: 1 addition & 1 deletion lib/polar_web/controllers/root_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ defmodule PolarWeb.RootController do
Streams.list_products([:active, :with_latest_version])
|> Enum.group_by(fn p -> {p.os, p.release} end)

render(conn, :show, layout: false, grouped_products: products)
render(conn, :show, page_title: gettext("OpsMaru Images"), grouped_products: products)
end
end
174 changes: 78 additions & 96 deletions lib/polar_web/controllers/root_html/show.html.heex
Original file line number Diff line number Diff line change
@@ -1,110 +1,92 @@
<.flash_group flash={@flash} />
<header class="bg-slate-900">
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold tracking-tight text-white">
<%= gettext("Image Server") %>
</h1>
</div>
</header>
<main>
<div class="bg-slate-950">
<div class="mx-auto max-w-7xl">
<div class="bg-slate-950 py-10">
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:items-center">
<div class="sm:flex-auto">
<h1 class="text-base font-semibold leading-6 text-white">
<%= gettext("Active Images") %>
</h1>
<p class="mt-2 text-sm text-slate-300">
<%= gettext(
"If you need something not available here please create an issue at the"
) %>
<a
href="https://github.com/upmaru/opsmaru-images"
class="text-indigo-400"
target="_blank"
>
<%= gettext("opsmaru-images") %>
</a>
<%= gettext("repository.") %>
</p>
</div>
<div class="bg-slate-950">
<div class="mx-auto max-w-7xl">
<div class="bg-slate-950 py-10">
<div class="px-4 sm:px-6 lg:px-8">
<div class="sm:flex sm:items-center">
<div class="sm:flex-auto">
<h1 class="text-base font-semibold leading-6 text-white">
<%= gettext("Active Images") %>
</h1>
<p class="mt-2 text-sm text-slate-300">
<%= gettext(
"If you need something not available here please create an issue at the"
) %>
<a
href="https://github.com/upmaru/opsmaru-images"
class="text-indigo-400"
target="_blank"
>
<%= gettext("opsmaru-images") %>
</a>
<%= gettext("repository.") %>
</p>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
<table class="min-w-full divide-y divide-slate-700">
<thead>
<tr>
<th
scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white sm:pl-0"
>
<%= gettext("Aliases") %>
</th>
<th
scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-white"
>
<%= gettext("Arch") %>
</th>
<th
scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-white"
>
<%= gettext("Variant") %>
</th>
</div>
<div class="mt-8 flow-root">
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div class="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
<table class="min-w-full divide-y divide-slate-700">
<thead>
<tr>
<th
scope="col"
class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-white sm:pl-0"
>
<%= gettext("Aliases") %>
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-white">
<%= gettext("Arch") %>
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-white">
<%= gettext("Variant") %>
</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-white">
<%= gettext("Published At") %>
</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-900">
<%= for {{os, release}, products} <- @grouped_products do %>
<tr class="border-t border-slate-800">
<th
scope="col"
class="px-3 py-3.5 text-left text-sm font-semibold text-white"
colspan="5"
scope="colgroup"
class="bg-slate-900 py-2 pl-4 pr-3 text-left text-sm font-semibold text-slate-50 sm:pl-3"
>
<%= gettext("Published At") %>
<%= Phoenix.Naming.humanize(os) %> - <%= release %>
</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-900">
<%= for {{os, release}, products} <- @grouped_products do %>
<tr class="border-t border-slate-800">
<th
colspan="5"
scope="colgroup"
class="bg-slate-900 py-2 pl-4 pr-3 text-left text-sm font-semibold text-slate-50 sm:pl-3"
>
<%= Phoenix.Naming.humanize(os) %> - <%= release %>
</th>
<%= for product <- products do %>
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white sm:pl-0">
<%= for alias <- product.aliases do %>
<span class="inline-flex items-center rounded-md bg-green-500/10 px-2 py-1 text-xs font-medium text-green-400 ring-1 ring-inset ring-green-500/20">
<%= alias %>
</span>
<% end %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= product.arch %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= product.variant %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= Calendar.strftime(
product.latest_version.inserted_at,
"%B %d, %Y %H:%M:%S"
) %>
</td>
</tr>
<%= for product <- products do %>
<tr>
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-white sm:pl-0">
<%= for alias <- product.aliases do %>
<span class="inline-flex items-center rounded-md bg-green-500/10 px-2 py-1 text-xs font-medium text-green-400 ring-1 ring-inset ring-green-500/20">
<%= alias %>
</span>
<% end %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= product.arch %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= product.variant %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-slate-300">
<%= Calendar.strftime(
product.latest_version.inserted_at,
"%B %d, %Y %H:%M:%S"
) %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>

0 comments on commit d63b5ed

Please sign in to comment.