From d63b5edf0b35ce9bad00ca66d4a897db9d0ebfae Mon Sep 17 00:00:00 2001 From: Zack Siri Date: Wed, 21 Feb 2024 15:54:34 +0700 Subject: [PATCH] Clean up root --- .../components/layouts/app.html.heex | 13 +- lib/polar_web/controllers/root_controller.ex | 2 +- .../controllers/root_html/show.html.heex | 174 ++++++++---------- 3 files changed, 84 insertions(+), 105 deletions(-) diff --git a/lib/polar_web/components/layouts/app.html.heex b/lib/polar_web/components/layouts/app.html.heex index ca1e2d2..a81be06 100644 --- a/lib/polar_web/components/layouts/app.html.heex +++ b/lib/polar_web/components/layouts/app.html.heex @@ -97,17 +97,14 @@ - -
+
-

- <%= assigns[:page_title] || "Polar" %> +

+ <%= assigns[:page_title] || "Polar Image Server" %>

-
- <.flash_group flash={@flash} /> - <%= @inner_content %> -
+ <.flash_group flash={@flash} /> + <%= @inner_content %>
diff --git a/lib/polar_web/controllers/root_controller.ex b/lib/polar_web/controllers/root_controller.ex index 03e303f..4bda7ea 100644 --- a/lib/polar_web/controllers/root_controller.ex +++ b/lib/polar_web/controllers/root_controller.ex @@ -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 diff --git a/lib/polar_web/controllers/root_html/show.html.heex b/lib/polar_web/controllers/root_html/show.html.heex index 7cb801c..1bbc679 100644 --- a/lib/polar_web/controllers/root_html/show.html.heex +++ b/lib/polar_web/controllers/root_html/show.html.heex @@ -1,110 +1,92 @@ <.flash_group flash={@flash} /> -
-
-

- <%= gettext("Image Server") %> -

-
-
-
-
-
-
-
-
-
-

- <%= gettext("Active Images") %> -

-

- <%= gettext( - "If you need something not available here please create an issue at the" - ) %> - - <%= gettext("opsmaru-images") %> - - <%= gettext("repository.") %> -

-
+
+
+
+
+
+
+

+ <%= gettext("Active Images") %> +

+

+ <%= gettext( + "If you need something not available here please create an issue at the" + ) %> + + <%= gettext("opsmaru-images") %> + + <%= gettext("repository.") %> +

-
-
-
- - - - - - + +
+
+
+
- <%= gettext("Aliases") %> - - <%= gettext("Arch") %> - - <%= gettext("Variant") %> -
+ + + + + + + + + + <%= for {{os, release}, products} <- @grouped_products do %> + - - - <%= for {{os, release}, products} <- @grouped_products do %> - - + <%= for product <- products do %> + + + + + - <%= for product <- products do %> - - - - - - - <% end %> <% end %> - -
+ <%= gettext("Aliases") %> + + <%= gettext("Arch") %> + + <%= gettext("Variant") %> + + <%= gettext("Published At") %> +
- <%= gettext("Published At") %> + <%= Phoenix.Naming.humanize(os) %> - <%= release %>
- <%= Phoenix.Naming.humanize(os) %> - <%= release %> -
+ <%= for alias <- product.aliases do %> + + <%= alias %> + + <% end %> + + <%= product.arch %> + + <%= product.variant %> + + <%= Calendar.strftime( + product.latest_version.inserted_at, + "%B %d, %Y %H:%M:%S" + ) %> +
- <%= for alias <- product.aliases do %> - - <%= alias %> - - <% end %> - - <%= product.arch %> - - <%= product.variant %> - - <%= Calendar.strftime( - product.latest_version.inserted_at, - "%B %d, %Y %H:%M:%S" - ) %> -
-
+ <% end %> + +
-
+